Hello guys ...
I'm trying to implement some javascript I found .. worked great on the original page that did NOT have any doctype .
And I think the code may bee wrong somewhere ..
The javascript ::
Code:
//__________________________________________________
// Nav
var T_Nav = "";
if (T_nav.search("MSIE") != -1) {T_Nav = "IE"}
if (T_nav.search("Netscape") != -1) {T_Nav = "FF"}
if (T_nav.search("Firefox") != -1) {T_Nav = "FF"}
if (T_nav.search("Opera") != -1) {T_Nav = "OP"}
if (T_nav.search("Safari") != -1) {T_Nav = "SA"}
//__________________________________________________
// Slider
PosxPubdep = -298;
PosxPubEnCours = -298;
SlideTimer = 0;
function ScrollPub(arg)
{
if (SlideTimer != 0){clearTimeout(SlideTimer); SlideTimer = 0;}
if (arg == "+")
{
PosxPubEnCours += 15;
if (PosxPubEnCours < 0)
{
document.getElementById("Pub_Slide").style.left = PosxPubEnCours;
SlideTimer = setTimeout("ScrollPub('+')",10);
}
else
{
PosxPubEnCours = 0
document.getElementById("Exclam").style.left = 297 + 'px';
document.getElementById("Pub_Slide").style.left = 0 + 'px';
}
}
else
{
PosxPubEnCours -= 20;
if (PosxPubEnCours > PosxPubdep)
{
document.getElementById("Pub_Slide").style.left = PosxPubEnCours;
SlideTimer = setTimeout("ScrollPub('-')",10);
}
else
{
PosxPubEnCours = PosxPubdep
document.getElementById("Exclam").style.left = 301 + 'px';
document.getElementById("Pub_Slide").style.left = PosxPubdep;
}
}
}
Pos_Y_Slide=0;
temps_Slide=30;
max=30;
function Init_Slide()
{
Pos_Y_Slide=document.body.clientHeight/2 + (196/2);
setTimeout("Start_Slide()",temps_Slide);
}
function Start_Slide()
{
Deplacer_Slide("Pub_Slide",Postionimage("Pub_Slide"));
setTimeout("Start_Slide()",temps_Slide);
}
function Deplacer_Slide(nom,top)
{
document.getElementById(nom).style.top = top;
}
function Postionimage(nom)
{
var pos=parseInt(document.getElementById(nom).style.top);
var wintop=parseInt(document.body.scrollTop);
var dispo=document.body.clientHeight;
var diff=Math.ceil((pos-(wintop+dispo-Pos_Y_Slide)));
if (diff>max) {diff=max;}
if (diff<-1*max) {diff=-1*max;}
var top=pos-diff;
return top;
}
//__________________________________________________
//
if (T_Nav == "IE" || T_Nav == "SA")
{
function blink_show()
{
blink_tags = document.all.tags('blink');
blink_count = blink_tags.length;
for ( i = 0; i < blink_count; i++ ) {blink_tags[i].style.visibility = 'visible';}
window.setTimeout( 'blink_hide()', 700 );
}
function blink_hide()
{
blink_tags = document.all.tags('blink');
blink_count = blink_tags.length;
for ( i = 0; i < blink_count; i++ ) {blink_tags[i].style.visibility = 'hidden';}
window.setTimeout( 'blink_show()', 250 );
}
}
yeah, thanks for that .. mist it, but still it does not solve the problem .
the only way around it is to delete the doctype, and that is not a good ideea ...
i seem to be resolving one problem, and getting a fresh onez after that ....
in the javascript, if the height is bigger the the var max it should stop going down, but it does to the center of the screen...
max=30;
Bookmarks