PDA

View Full Version : Resolved request help with applying Neon Lights Text II effect to selected tab in Ajax Tabs Co



olegv
12-21-2011, 11:11 PM
request help with applying Neon Lights Text II effect to selected tab in Ajax Tabs Content Script (v 2.2)

1. Script Titles: Neon Lights Text II and Ajax Tabs Content Script (v 2.2)
2. URLs:
Neon Lights Text II: http://www.dynamicdrive.com/dynamicindex10/neontext2.htm
Ajax Tabs Content Script: http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3. I am trying to apply Neon Lights Text effect to selected tab in Ajax Tabs Content Script.

My current codes (see below) apply Neon Lights to selected tab after loading page, but if I select another tab I need to reload page to see Neon Lights on a new tab.

Any help or ideas are welcome!
Here is my current codes:


// Ajax Tabs Content Script working fine:
<ul id="countrytabs" class="modernbricksmenu">
<li><a href="external.php" class="selected" rel="#default">Tab 1</a></li>
<li><a href="external2.php" rel="countrycontainer">Tab 2</a></li>
<li><a href="external3.php" rel="countrycontainer">Tab 3</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
</ul>
<div id="countrydivcontainer" style="smallblack"></div>

<script type="text/javascript">
var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link")
countries.init()
</script>

// Neon Lights Text: original lines are //

//var message="Thank you for visiting Dynamic Drive!"
var message= countrytabs.tabs[countrytabs.currentTabIndex].innerHTML //my modification
var neonbasecolor="gray"
var neontextcolor="yellow"
var neontextcolor2="#FFFFA8"
var flashspeed=100
var flashingletters=3
var flashingletters2=1
var flashpause=0
var tabtext="" //my modification

var n=0
if (document.all||document.getElementById){

//document.write('<font color="'+neonbasecolor+'">')
tabtext='<font color="'+neonbasecolor+'">' // my modification

for (m=0;m<message.length;m++)

//document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
tabtext=tabtext+'<span id="neonlight'+m+'">'+message.charAt(m)+'</span>' // my modification

//document.write('</font>')
tabtext=tabtext+'</font>' // my modification
countrytabs.tabs[countrytabs.currentTabIndex].innerHTML=tabtext
}
else
//document.write(message)

function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}

function neon(){

if (n==0){
for (m=0;m<message.length;m++)
crossref(m).style.color=neonbasecolor
}

crossref(n).style.color=neontextcolor

if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2
if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor


if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",flashpause)
return
}
}

function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>


Best wishes and Happy New Year!

Oleg

olegv
12-22-2011, 01:17 AM
OK, the problem is solved.