The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> <frame> not displaying page
cputom
post May 6 2012, 04:53 AM
Post #1





Group: Members
Posts: 2
Joined: 6-May 12
Member No.: 17,061



OK i'm trying to make an image scroller using jquery work within a frame. I put all the code in banner.html it works fine, but whenever i try to use it within <frame src="banner.html"/> it doesn't load anything into the frame at all.

layout.css

slideshow {
position:relative;
height:400px;
}
slideshow IMG {
position:absolute;
top:0;
left:0;
z-index:8;
opacity:0.0;
}
slideshow IMG.active {
z-index:10;
opacity:1.0;
}
slideshow IMG.last-active {
z-index:9;
}

banner.html

<head>
<link href="layout.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript">
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');});}
$(function() {
setInterval( "slideSwitch()", 5000 );
});
</script>
<div id="slideshow">
<img src="images/banner1.jpg" alt="Contact us" class="active" />
<img src="images/banner2.jpg" alt="Services" />
</div>
</head>
<body>
</body>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
cputom
post May 6 2012, 05:10 AM
Post #2





Group: Members
Posts: 2
Joined: 6-May 12
Member No.: 17,061



nvm i saved the javascript of banner.html into its own .js file and just linked every page to it ty anyways sorry for waste of time.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post May 6 2012, 07:41 AM
Post #3


Programming Fanatic
********

Group: Members
Posts: 4,516
Joined: 23-August 06
From: Europe
Member No.: 9



Nevertheless, your HTML code has an error:

- you should close the HEAD after the CSS and script call(s),
- the DIV needs to be inside BODY (not before).


--------------------
"The earth does not belong to us. We belong to the earth."
from Vue du ciel (in French)

"Leave scepticism to others and take action"
from HOME by Goodplanet

An inconvenient truth by Al Gore
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th November 2014 - 01:01 PM