PDA

View Full Version : help needed with javascript and cell background



mmoalem
02-10-2009, 12:40 AM
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

mmoalem
02-10-2009, 11:27 AM
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

mmoalem
02-10-2009, 01:29 PM
thanks but it still not working
modified line:

<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>

codeexploiter
02-11-2009, 04:12 AM
Try the following one


<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

mmoalem
02-11-2009, 12:41 PM
finally it has worked! thank you