jQuery loads only 2 out of 3 times
Posted: Fri Nov 12, 2010 11:52 am
Hi,
First, I do not know whether I posted it in the right board, apologies of it isn't.
I am currently working on a site which uses 3 jQuery effects:
- a sliding panel on the top
- a fading element for the entire body (used to preview the backgroundimage)
- 3 featured content elements
The problem lays with the last one. All 3 effects use the same version of jQuery (1.4.2),
which are included with . But when I look at the page, the effect is not working.
The page which has the error is on http://moosach-bikes.nl/dev/cmsms/,
and a example of how it should be is on http://moosach-bikes.nl/dev/html/.
The second page is all HTML/CSS/jQuery, the first one is CMSMS.
This is the code of the section:
Note: The scrollbarfunctions are working properly.
The divs are all correctly named. Obviously, jQuery gets loaded or else the sliding panel and fadeOut() wouldn't work. But I am really stuck here, and even tried to use the jQuery module but that had so much error messages that that failed too (I even tried a older version of the module).
Thanks in advance!
First, I do not know whether I posted it in the right board, apologies of it isn't.
I am currently working on a site which uses 3 jQuery effects:
- a sliding panel on the top
- a fading element for the entire body (used to preview the backgroundimage)
- 3 featured content elements
The problem lays with the last one. All 3 effects use the same version of jQuery (1.4.2),
which are included with . But when I look at the page, the effect is not working.
The page which has the error is on http://moosach-bikes.nl/dev/cmsms/,
and a example of how it should be is on http://moosach-bikes.nl/dev/html/.
The second page is all HTML/CSS/jQuery, the first one is CMSMS.
This is the code of the section:
Note: The scrollbarfunctions are working properly.
Code: Select all
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Moosach</title>
<link href="css/Safari.css" rel="stylesheet" type="text/css" />
<link href="scripts/s3/s3Slider.css" rel="stylesheet" type="text/css" />
<__script__ type="text/javascript" src="scripts/jquery-1.4.2.js"></__script>
<!-- stylesheets -->
<link rel="stylesheet" href="scripts/slider/slide.css" type="text/css" media="screen" />
<!-- Sliding effect -->
<__script__ type="text/javascript" src="scripts/s3/s3Slider.js"></__script>
<__script__ type="text/javascript">
$(document).ready(function() {
// Slider on top ("Fietsmand (8)")
$("#open").click(function(){
$("div#panel").slideDown2("slow");
});
// Collapse Panel
$("#close").click(function(){
$("div#panel").slideUp2("slow");
});
// Switch buttons from "Log In | Register" to "Close Panel" on click
$("#toggle a").click(function () {
$("#toggle a").toggle();
});
//featured content block, the part which doesn't seem to work
$('#slider').s3Slider({
timeOut: 3000
});
$('#slider2').s3Slider({
timeOut: 3000
});
$('#slider3').s3Slider({
timeOut: 3000
});
//fadeOut element (at the bottom of the page "TOON ACHTERGROND")
var bg_toggle = "out";
$('a#bg_toggle').click(function ()
{
if (bg_toggle == "out")
{
$('#content').fadeOut2('slow', function()
{
bg_toggle = "in";
$('bottom-bar a').toggle();
document.getElementById("bottom-bar").style.marginTop = "20px";
});
}
else
{
document.getElementById("bottom-bar").style.marginTop = "0px"; //deze staat buiten de fadeIn2 loop zodat het element niet 'verspringt' nadat de fadeIn2 compleet is
$('#content').fadeIn2('slow', function()
{
bg_toggle = "out";
$('bottom-bar a').toggle();
});
}
});
});
function CheckScrollBar(ObjectId,Aces)
{
if (!Aces)
{
Aces="either x or y";
}
if (IsScrollBarExist(ObjectId,Aces))
{
document.getElementById("toppanel").style.marginLeft = "-2px";
}
else
{
document.getElementById("toppanel").style.marginLeft = "6px";
}
}
function IsScrollBarExist(ObjectId,Aces)
{
Object=document.getElementById(ObjectId);
switch (Aces)
{
case 'x' :
Object.scrollLeft=1;
if (Object.scrollLeft>0) {Object.scrollLeft=0; return true;}
else {return false;}
break;
case 'y' :
Object.scrollTop=1;
if (Object.scrollTop>0) {Object.scrollTop=0; return true;}
else {return false;}
break;
case 'xy' :
Object.scrollTop=1;
Object.scrollLeft=1;
if (Object.scrollTop>0 && Object.scrollLeft>0) {Object.scrollTop=0; Object.scrollLeft=0; return true;}
else {return false;}
break;
default :
Object.scrollTop=1;
Object.scrollLeft=1;
if (Object.scrollTop>0 || Object.scrollLeft>0) {Object.scrollTop=0; Object.scrollLeft=0; return true;}
else {return false;}
break;
}
}
</__script>
</head>
Thanks in advance!