Results 1 to 5 of 5

Thread: help needed with javascript and cell background

  1. #1
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help needed with javascript and cell background

    hi there all - new here (and quite new to webdesign and html) so i hope i get the question right and in the right forum.
    I am designing a website for myself and the way i do it is by looking around the web for code and scripts which perform similar task to what i am looking for and than trying to figure out what they actually do by trial and error and hacking them to do what i need - not the best method i know...
    anyway this is how i got here after using one of the scripts on the site 'ddsmoothmenu'.

    This is the site i'm working on:
    http://michelmoalem.awardspace.com/index2.html

    I have used a table to make sure all elements are positioned correctly on the page (am i right to choose a table for that?). I have devided the menu into 4 menus to position them correctly (couldnt figure out how to position them in the ddsmoothmenu script)

    the menu links change content in the main cell (id="cell1")which seems to work but because the video size (click 'sample footage'>'showreel' to see) is smaller than the cell, i want to loose the animated gif background when playing a video and restore it when displaying text and i cant get this to work... i am trying it on the link: 'credits' -> 'test' and use this code:

    <li><a href="#" onclick="document.getElementById('celltest').style.backgroundImage = 'red1.gif'; document.getElementById('cell1').innerHTML=('<p><b>Michel Moalem - Film And Video Work</b></p>')">test</a></li>
    hope you get the picture from this rumblings...

    and if anyone ends up looking at the page source code and spot any problems please advise me about it...

    thank you in advance

    michel

  2. #2
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi there all - kind of hacked it by specifing the size of the embeded player to fit the cell size:
    http://michelmoalem.awardspace.com/index3.html
    but its a dirty hack - if anyone know how to code the background toggle properly please still advise

  3. #3
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks but it still not working
    modified line:
    Code:
    <li><a href="#" onclick="document.getElementById('cell1').style.backgroundImage.src = 'red1.gif'; document.getElementById('cell1').innerHTML=('<p><b>Michel Moalem - Film And Video Work</b></p>')">test</a></li>

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Try the following one

    Code:
    <li><a href="#" onclick="document.getElementById('cell1').style.backgroundImage = 'url(red1.gif)'; document.getElementById('cell1').innerHTML= '<p><b>Michel Moalem - Film And Video Work</b></p>'">test</a></li>
    Highlighted the changes.

    Hope this helps

  5. #5
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    finally it has worked! thank you

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
  •