The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> <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
 
Reply to this topicStart new topic
Replies
Frederiek
post May 6 2012, 07:41 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


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: 16th April 2024 - 12:53 PM