PDA

View Full Version : Wrapper divs and Javascript problemo


Electrodesign
03-17-2007, 06:57 PM
Hi Guys,
I followed the Mike Crone tutotial on wrappers and centering content on this fine Site. It made a real difference to the layout and i'd like to use this by default in the future but theres something niggling away at me about using wrapper divs and javascript add ons.
I'll explain, i made a template with a wrapper as instructed, placing all main body content within the div tags. I added a couple of javascripts ( banner rotation, news ticker etc) and when i place any code into the head section, the main content table in design view dissapears!
Although, when previewed in browser or uploaded to the web, all seems fine, but if i need to change anything, i can't access it in wysiwyg.
If this is familiar to anyone and can you point me towards a solution?
It may be that i have missed something glaringly obvious but i'm stuck on it. I've tried retracing my steps but it only reverts to normal if I remove javascript from the head section.
Regards
Hubert

gmcrone
03-18-2007, 07:51 AM
Depending on the js, it does not necessarily have to go into the head section.

1. Try putting your js code into the div where you want it to appear.
2. Or put your js code into an external file and just call it from your div on the page.

It does sound strange that your content disappears.
Do you have a URL where we can see the code ??

Mike...

domedia
03-18-2007, 11:26 AM
We need to see the actual code.

Electrodesign
03-21-2007, 08:23 AM
Thanks for replying.
I didn't know that I could call js from a remote location.
I'll try that and see if it works.
I'd been using a couple of scripts that needed some of the code in the head section and the rest where the script needed to be placed.
The problem occured when i placed the head code into the headsection, the table that contained the actual script ( in the body section) dissapeared from view.
Sorry i cant send the code as i've scrapped it and started again using an outer table with a percentage value and the margin set to a percentage value to handle the resize.
Is there difference or disadadvantage of doing this over using a wrapper div?
Thanks again
Hubert