Web Analytics Made Easy -
StatCounter Image placement - CodingForum

Announcement

Collapse
No announcement yet.

Image placement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Image placement

    Hi all.

    I have been playing with including images I've created within tables to produce an onMouseOver effect for menu options rather than a standard link.

    It works ok but not perfectly, which raises two questions.

    1. Is there a minimum height for a table row? It doesn't seem to matter what I define the height to be below a certain value.

    2. Can I "place" an image wherever I want to on the screen or does it simply render itself at the point in the HTML at which I introduce it? I would like, ideally, to position it using something like I would in normally object-oriented programming. That is, something like:

    image.left.value = 90
    image.top.value = 50

    Is this possible using JavaScript within HTML pages?

    Thanks in advance.

    Russell.

  • #2
    Well to position an image like that you could do this.

    <img src="imageurl.gif" style="position:absolute;top:90;left:100;">
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

    Comment


    • #3
      to reposition it using javascript, you use this

      document.imageref.style.left = "10px"
      document.imageref.style.top = "10px"

      i think there might besome cross browser problems with that type of stuff but i'm not sure
      photoshop too expensive? use the GIMP! www.gimp.org

      Comment


      • #4
        Thanks a lot

        To ACJavascript and whackaxe.

        Thank you both very much. That's exactly what I wanted.

        Russell.

        Comment

        Working...
        X