Results 1 to 2 of 2

Thread: Watermark Background Image randomizer script

  1. #1
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Watermark Background Image randomizer script

    My goal is to have a page with a single image displayed and when the page is visited again it chooses a different picture.

    Have the following script and on line the "if (document.all)" I keep getting A Runtime Error occurred: Unterminated string constant

    The first picture displays but cannot figure out this Runtime error?

    I'm using FP 2004.

    <%@ Language="VBScript" %>
    <% Option Explicit %>

    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>random</title>

    <%
    Randomize
    dim num, picNum, ArrPics
    ArrPics =
    Array("media/picts/INDEX_images/1977_1.jpg","media/picts/INDEX_images/1980_1.jpg","media/picts/INDEX_images/1980_3.jpg"
    picNum = 2
    num = Round(Rnd*picNum)
    %>

    </head>

    <p align="center">

    <img src="<% Response.Write (ArrPics(num)) %>" alt=" ">

    <script language="JavaScript1.2">

    /*
    Watermark Backgound Image Script-
    ) Dynamic Drive (www.dynamicdrive.com)
    For full source code, installation instructions,
    100's more DHTML scripts, and Terms Of
    Use, visit dynamicdrive.com
    */

    if (document.all)
    document.body.style.cssText="url('media/picts/INDEX_images/1980_1.jpg')
    no-repeat fixed center center"
    </script>

    <p align="center">
    <a target="_blank" href="http://www.website.com/index.asp"><img border="0" src="media/picts/INDEX_images/1977_1.jpg"></a></p>

    <p align="center">
    <a target="_blank" href="http://www.website.com/index.asp">Blah Blah</a></p>

    </html>

    Thanks for your help!!!!

  2. #2
    Join Date
    Jan 2005
    Location
    Seattle
    Posts
    53
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    this line might be it:
    document.body.style.cssText="url('media/picts/INDEX_images/1980_1.jpg')
    no-repeat fixed center center"

    it should be all in one line:
    document.body.style.cssText="url('media/picts/INDEX_images/1980_1.jpg')no-repeat fixed center center"

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •