SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    liverpool
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    layers and dhtml

    Right i want to do my own script that can scroll a layer ands i'm starting from scratch...
    So i have a layer in a page - described with an inline style sheet,
    there is a number to describe the left position -hard coded. I am having trouble exchanging that for a variable that i will update with javascript.
    In fact have alook at this

    var hhh = 300;
    document.write("<p style='font-family: Verdana, Arial, Helvetica, sans-serif; position:absolute; right=300'>text here</p>");
    </script>

    that works but not when i exchange 300 for hhh
    any ideas
    Phil

  2. #2
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off the top of my head:
    Code:
    <p style='[...] position:absolute; right="+hhh+"px'>text here</p>"
    You'll notice I snuck a "px" in there, too: you need to specify units on lengths.

    From your other comments though, you're planning to just update the variable to move the layer - that won't work.

    Since you didn't just come right out and ask, I figure you want to try and work things out for yourself, but feel free to ask the crowd here for help.

  3. #3
    SitePoint Member
    Join Date
    Jun 2003
    Location
    liverpool
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indeed it wouldn't - i worked it out though - cheers for the help and suggestions. No doubt i'll be back soon.
    t.i.e.


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
  •