/    Sign up×
Community /Pin to ProfileBookmark

Need help with this Javascript

Need help with this Javascript. This may be simple.

When customers come to my site I want a little bar at the top..to shove down and display as the “FF3 Remember your password” except I have a premade image to come down, saying this site works best with these browsers, and if you need them you can click on it to forward you to a page of your choice.

So it just needs a aref tag and no buttons. I just want it to show a this button if they are using any version of IE.

Am i explaining myself clearly? I attached the file I want to appear at the top.

Thanks in advance

[upl-file uuid=1f918417-1f2a-4017-a039-fd6bbe06a5fd size=38kB]browsers.jpg[/upl-file]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@j0n0Oct 01.2008 — have you got any code or do you want this from scratch?
Copy linkTweet thisAlerts:
@portalgraphicsauthorOct 01.2008 — I want it from scratch. Even if someone does it i'll paypal them 15 dollars for the working code. Thanks!
Copy linkTweet thisAlerts:
@j0n0Oct 01.2008 — I have a solution for you - but patience will be key

This is the js


// add links

// tabs("<a href=0.php>Naught</a><a href=1.php>One</a>",1)

// the W variable will also be attached to these links.

// you can add tooltips and attributes to these links.

// v argument will mark a link as class=active

// the tab bar will be positioned at top:0;left:0;width:100&#37;.

function tabs(l,v)

{

G_wd()

v=(v>-1?v:-1)

var a=""

if(!FF)

a+="<style type=text/css>.TabS a:link,.TabS a:visited,.TabS a:hover,.TabS a.active:link,.TabS a.active:visited,.TabS a.active:hover{height:23;font-weight:bold}</style>"

a+="<table class=TabS id=TabS style=width:"+(FF||window.miE?"100%":ww-17)+" ondblclick="this.style.visibility='hidden'">"

a+="<tr><th>"

if(l)

{

l=l.split("</a>")

var i=0

while(l[i])

{

if(window.W)

{

p1=l[i].replace(/= /g,"=").replace(/ =/g,"=").replace(/>/g," >")

p2=p1.substr(p1.indexOf("href=")+5)

p1=p1.substr(0,p1.indexOf("href=")+5)

p3=p2.substr(p2.indexOf(" "))

p2=p2.substr(0,p2.indexOf(" "))

p2=p2.replace(/"/g,"").replace(/'/g,"").replace(/ /g,"")

if(p2=="#"||p2=="javascript:void(0)")

p2="javascript:void(0)"

else

{

if(p2.indexOf("?")>0)

p2=p2+"&W="+W

else

p2=p2+"?W="+W

if(window.WR)

p2=p2+"&WR="+WR

}

l[i]=(p1+p2+p3.replace(/ >/g,">"))

}

if(l[i].toLowerCase().indexOf("onfocus=blur()")<0)

l[i]=l[i].replace(">"," onfocus=blur()>")

if(v==i)

l[i]=l[i].replace(">"," class=active>")

a+=l[i]+"</a>"

i++

}

}

a+="</tr>"

a+="<tr><td><br></td></tr>"

a+="</table>"

document.write(a)

}



function TabScroll(h)

{

clearTimeout(MENU_t["tabS"])

var t=document.getElementById("TabS")

if(h)

{

if(h==99)

{

t.style.top=sy-t.offsetHeight

MENU_t["tabS"]=setTimeout("TabScroll(1)",16)

}

else

{

t.style.visibility=""

var y=parseInt(t.style.top)

if(y<sy)

{

t.style.top=y+1

MENU_t["tabS"]=setTimeout("TabScroll(1)",16)

}

}

}

else

{

var y=parseInt(t.style.top)

if(y!=sy)

{

var h=y+t.offsetHeight

if(sy>y&&sy<h)

MENU_t["tabS"]=setTimeout("TabScroll(1)",800)

else

{

t.style.visibility="hidden"

MENU_t["tabS"]=setTimeout("TabScroll(99)",800)

}

}

}

}



[/QUOTE]




this is the CSS





.TabS{position:absolute;top:0;left:0;border-collapse:collapse;z-index:9990;border:0}

.TabS th{vertical-align:middle;padding:0;#EEE;white-space:nowrap;height:19;overflow:hidden;border:0}

.TabS td{padding:0;border:0;height:6;line-height:1%;font-size:1pt}

.TabS a:link,.TabS a:visited,.TabS a:hover,.TabS a.active:link,.TabS a.active:visited,.TabS a.active:hover{height:19;display:block;float:left;text-decoration:none;white-space:nowrap;color:#888;font-size:9pt;padding:4 7 0 8;line-height:100%;font-weight:bold;border-style:dotted;border-width:0 1 0 0;border-color:#CCC;margin:0}

.TabS a.active:link,.TabS a.active:visited,.TabS a.active:hover{color:#FFF;cursor:default;#CC0000 0px 17px}

.TabS a:hover{color:#000;#FFF}

[/QUOTE]






load it like this:



<script>tabs("<a href=#>stuff in here</a><a href=#>other stuff</a>")</script>"

[/QUOTE]


Ive never tried this outside the system it lives on so you may have to mess with it a bit
Copy linkTweet thisAlerts:
@portalgraphicsauthorOct 03.2008 — Wow! Thank you! I'll see how that works!

Thanks so much!
Copy linkTweet thisAlerts:
@j0n0Oct 07.2008 — ok whats the problem
×

Success!

Help @portalgraphics spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...