Page 2 of 2
Re: JavaScript problem
Posted: October 16th, 2011, 23:36
by ProfHawking
Quick update:
http://jsfiddle.net/24nAv/40/
Forgot to add the "c" class when reopening
Re: JavaScript problem
Posted: October 17th, 2011, 0:43
by Thompy
Just realised IE was blocking scripts. I was
to the pop up at the bottom. So it works! Shockingly though Chrome doesn't like it
Btw there needs to be a c class on the sub category that is currently open also. But I might just forget about the whole highlighting thing and make the styling static.
My worry is that while (again) this is great stuff, it's getting way too complicated for me to fiddle with slightly. My site is still a work in progress from a design point of view, so if I change things it's gonna break the code and I won't know what to do. Like I said in that long post just before, I'm feeling guilty about you guys working on this when I'm not sure I can use it or have to keep asking for corrections/additions.
I think I will just do a full list like
here with no adding and removing classes for styling crap needed. The only thing that'd would be nice is to load in the menu from a single page, otherwise I'm still updating loads of pages every time I add a link. Do you recommend putting the menu in a iframe and setting target for the links as "_top" (I can't set the content side of things into an iframe because each page will have different heights, and as far as I know you can't tell iframes to scale to fit content without hacks), or JS? Bearing in made the simplicity and small audience of the site.
Re: JavaScript problem
Posted: October 17th, 2011, 1:06
by ProfHawking
okies. well changing your site design proably wont break the javascript there unless you mess with the main menu classes. but anyway if you want to keep it simple of course no worries. but i expect someone on here will always be about if you ever need someone to explain how it works so you can understand it better/fix in he future.
as for your menu markup, yes dont copy it everywhere. your options are server side (php, asp, perl etc) to include a menu file on every page, or client side with javascript.
if you want to keep it all in js, take a look at the jquery load function - this will let you pull in a menu file into a div or something.
remember, if you do that, anyone with no javascript support wont get a menu.
Re: JavaScript problem
Posted: October 17th, 2011, 1:59
by Thompy
I didn't realise it was as simple as "<?php include("filename.html"); ?>"
Awesome.
I'll try using your menu code also. I think I'm set for now but I might bother you again at some point.
Cheers guys.