WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You

WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Make Marquee show random Empty Make Marquee show random Sat May 29, 2010 4:09 pm

Unknown Data

Unknown Data
Registered Member
Registered Member
Hello everyone!

I got his marquee code with some of my affiliates, but I want them to be show different each time i goes sliding down. How can I do that?

Code:
<script language="JavaScript1.2">

//Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function makevisible(cur,which){
strength=(which==0)? 1 : 0.2

if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}

</script>

<center>
<marquee behavior='scroll' align='center' valign='bottom' direction='up' width='120' height='170' scrollamount='1' scrolldelay='1' onmouseover='this.stop()' onmouseout='this.start()'>

<p align='center'><a href='http://poketeam.dk' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://poketeam.dk/banner/poketeam_banner1.png' border='0' title='PokeTeam' alt='PokeTeam'></a>

<p align='center'><a href='http://pokeballen.forumotion.com' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://i39.tinypic.com/5ororl.png' border='0' title='Pokeballen' alt='Pokeballen'></a>

<p align='center'><a href='http://digimons-world.de' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://digimons-world.de/images/is/link/link4.jpg' border='0' title='Digimons World' alt='Digimons World'></a>

<p align='center'><a href='http://manga-f.dk' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://www.manga-f.dk/PartnerLinkBilleder/1.png' border='0' title='Manga F' alt='Manga F'></a>

<p align='center'><a href='http://pokemon-legend.byethost3.com/news.php' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://i50.tinypic.com/51u1dt.png' border='0' title='Pokemon Legend' alt='Pokemon Legend'></a>

<p align='center'><a href='http://www.pokemonen.forumotion.com' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://i41.tinypic.com/4v0bcg.png' border='0' title='Pokemonen' alt='Pokemonen'></a>
                               
</div></p></marquee>
</center>

~Unknown Data

http://woops.dk

2Make Marquee show random Empty Re: Make Marquee show random Sat May 29, 2010 11:24 pm

ankillien

ankillien
Administrator
Administrator
Hi Unknown Data!

Do you want the marquee to reposition the <p> tags randomly when it completes one round of scrolling? Am I getting it correct?

3Make Marquee show random Empty Re: Make Marquee show random Sun May 30, 2010 1:41 am

Unknown Data

Unknown Data
Registered Member
Registered Member
Yes Wink

http://woops.dk

4Make Marquee show random Empty Re: Make Marquee show random Sun May 30, 2010 2:15 pm

ankillien

ankillien
Administrator
Administrator
I have come up with this...

Code:
<script language="JavaScript" type="text/javascript">
//Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function makevisible(cur,which){
strength=(which==0)? 1 : 0.2

if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}
</script>

<style type="text/css">
.jsclass body .randomordercontent{
display: none;
}
</style>

<script type="text/javascript">
/***********************************************
* Random Order Content (from DIVs) script- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

if (document.getElementById)
document.documentElement.className = 'jsclass'; //hide content for DOM capable browsers


var randomordercontentdisplay={
   divholders:new Object(),
   masterclass: "randomordercontent",

   init:function(){
      if (!document.getElementById)
         return
      var alldivs=document.getElementsByTagName("div")
      var randomcontentsearch=new RegExp(this.masterclass+"\\s+(group\\d+)", "i") //check for CSS class="randomcontent groupX" (x=integer)
      for (var i=0; i<alldivs.length; i++){
         if (randomcontentsearch.test(alldivs[i].className)){
            if (typeof this.divholders[RegExp.$1]=="undefined"){ //if object to hold this group of divs doesn't exist yet
               this.divholders[RegExp.$1]=new Object() //create object
               this.divholders[RegExp.$1].ref=[] //create array to hold each div within group
               this.divholders[RegExp.$1].contents=[] //create array to hold each div's content within group
            }
               this.divholders[RegExp.$1].ref.push(alldivs[i]) //add this div to the array
               this.divholders[RegExp.$1].contents.push(alldivs[i].innerHTML) //add this div's content to the array
         }
      }
   this.scrambleorder()
   },

   scrambleorder:function(){
      for (group in this.divholders){ //loop thru each array within object
         this.divholders[group].contents.sort(function() {return 0.5 - Math.random()}) //scramble contents array
         for (var i=0; i<this.divholders[group].ref.length; i++){
            this.divholders[group].ref[i].innerHTML=this.divholders[group].contents[i]
            this.divholders[group].ref[i].style.display="block"
         }
      }
   }
}
</script>

<center>
<marquee behavior='scroll' align='center' valign='bottom' direction='up' width='120' height='170' scrollamount='1' scrolldelay='1' onmouseover='this.stop()' onmouseout='this.start()'>

<div class="randomordercontent group1">
<p align='center'><a href='http://poketeam.dk' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://poketeam.dk/banner/poketeam_banner1.png' border='0' title='PokeTeam' alt='PokeTeam'></a></p>
</div>

<div class="randomordercontent group1">
<p align='center'><a href='http://pokeballen.forumotion.com' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://i39.tinypic.com/5ororl.png' border='0' title='Pokeballen' alt='Pokeballen'></a></p>
</div>

<div class="randomordercontent group1">
<p align='center'><a href='http://digimons-world.de' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://digimons-world.de/images/is/link/link4.jpg' border='0' title='Digimons World' alt='Digimons World'></a></p>
</div>

<div class="randomordercontent group1">
<p align='center'><a href='http://manga-f.dk' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://www.manga-f.dk/PartnerLinkBilleder/1.png' border='0' title='Manga F' alt='Manga F'></a></p>
</div>

<div class="randomordercontent group1">
<p align='center'><a href='http://pokemon-legend.byethost3.com/news.php' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://i50.tinypic.com/51u1dt.png' border='0' title='Pokemon Legend' alt='Pokemon Legend'></a></p>
</div>

<div class="randomordercontent group1">
<p align='center'><a href='http://www.pokemonen.forumotion.com' target='_blank'> <img style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" src='http://i41.tinypic.com/4v0bcg.png' border='0' title='Pokemonen' alt='Pokemonen'></a></p>
</div>

</marquee>
</center>

<script type="text/javascript">
randomordercontentdisplay.init()
</script>

This script will make the images display randomly on each page refresh. However, it doesn't seem to be possible to make it shuffle on each round of scrolling :/

5Make Marquee show random Empty Re: Make Marquee show random Sun May 30, 2010 8:35 pm

Unknown Data

Unknown Data
Registered Member
Registered Member
thank you very much, just what i want.

Problem is solved

http://woops.dk

6Make Marquee show random Empty Re: Make Marquee show random Sun May 30, 2010 10:43 pm

ankillien

ankillien
Administrator
Administrator
Glad I could help Very Happy

Solved | Locked

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum