Jump to content

styleSelected script


sneezy32

Recommended Posts

Hi there,

 

built a sliding gallery with a tab control at the top. I have a script which appears to work in Firefox but not IE. THe issus is the tabs are sticking to the right divs when you leave the page and then come back to it.

 

Any suggestions would be welcome

 

<%

'Dim registerScript

'registerScript ="onload=""changeStyle(document.getElementById('styleSelected').value);"""

%>

 

<!--#include virtual="/includes/navigation-includes/top-template.asp" -->

<!--#include file="page-name.asp" --><!-- to add a page name to all hub pages so that the page id in the side_nav_container.asp links to the page specified within the page-name.asp -->

<script src="/includes/javascript-includes/prototype.js" type="text/javascript" charset="utf-8"></script>

<script src="/includes/javascript-includes/effects.js" type="text/javascript" charset="utf-8"></script>

<script src="/includes/javascript-includes/slider.js" type="text/javascript" charset="utf-8"></script>

 

<div class="controls" id="gourmet">

<ul id="nav">

<li id="t-gourmet"><a href="#section1" onclick="changeStyle('gourmet');" id="gourmet-link">gourmet delight</a></li>

<li id="t-pamper"><a href="#section2" onclick="changeStyle('pamper');" id="pamper-link">pamper yourself</a></li>

<li id="t-modern"><a href="#section3" onclick="changeStyle('modern');" id="modern-link">modern chic</a></li>

<li id="t-grand"><a href="#section4" onclick="changeStyle('grand');" id="grand-link">grand opulence</a></li>

<li class="end" id="t-special"><a href="#section5" onclick="changeStyle('special');" id="special-link">special offers</a></li>

</ul>

<div class="scroller">

<div class="content">

 

<script type="text/javascript">

function changeStyle(obj) {

//alert(obj);

if(obj.length>0)

{

var links = document.getElementsByTagName("div")

for(i=0;i<links.length;i++) {

if (links.className=='controls')

{links.id=(obj);}

}

document.getElementById("styleSelected").value = obj;

//alert(document.getElementById("styleSelected").value);

}

 

} //end func

</script>

<input type="hidden" id="styleSelected" value=""></input>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.