Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

is random imaging a behavior?

New Here ,
Aug 08, 2006 Aug 08, 2006
is random imaging a behavior already available or one i need to find/load or neither? i want a different image to appear (1 of 6) each time any user goes to the page - but not sure how to do this.
TOPICS
Server side applications
275
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 08, 2006 Aug 08, 2006
It's not a DW behavior, but it's simple enough to do.

Put this in the head of the document -

<script type="text/javascript">
<!--
function displayRandomImage(imageName,array){
document.images[imageName].src=array[new Date().getTime()%array.length];
}
urls=["images/cs1.jpg","images/cs2.jpg","images/cs3.jpg","images/cs4.jpg"]
// load this line with your image names and paths
//-->
</script>

and then put this in the body of the page -

<body onLoad="displayRandomImage('csmember',urls)">
<!-- csmember is the HTML NAME (not the filename) of the image receiving the
random changes -->

You can see this in action here -
http://www.dreamweaverresources.com/tutorials/randomimage_perpage.html

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"dmeloneh" <webforumsuser@macromedia.com> wrote in message
news:ebaup0$8ok$1@forums.macromedia.com...
> is random imaging a behavior already available or one i need to find/load
> or neither? i want a different image to appear (1 of 6) each time any
> user goes to the page - but not sure how to do this.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2006 Aug 09, 2006
LATEST
thanks for the help - you're awesome! demh
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines