Forum Moderators: not2easy
I am wondering which is better, to have a general display class (Like having a class called blocke, another invisible and so on) or display property in the other css classes and id properties.
The problem is that setting the element display to none to hide them is pretty easy, the problem occurs when trying to return the display to it's original state seeing as some are block and some inline.
I currently have a mix but am having trouble writing a general hide and show function (In javascript) so I am planning to rewrite everything.
2 choices as I see:
1 - Make general display classes (Block and invisible) and not set the display property on the other css elements and then being able to change the dislpay property of the element itself via javascript and check it's class to return it to normal. This would imlpy that a lot of the elements in the page would be multi-classed (Not a real problem I think)
2 - Set the display property for most css elements (Those that need it) and one invisible class so I can just remove the invisibility class of the object upon need to set it back to normal. This would imply a lot more css coding (As some elements only need the display propety set) and I am not sure how javascript would be able to handle the hide and show functions.
Has anybody got any other suggestions. I'd like to hear thoughts on what you guys think and what would be the best solution to tackle such problem.
Best Regards
NooK
I am still struggling with one thing, it would be nice to write a generic changing function to change the display properties of certain elements but for that I'd have to know what were their original values after I change them and want to revert back.
Is it possible to get the property set in the css file rather than the elements current property (Which might have been changed through Javascript)? I dont think it is possible in which case the only way I see it is either write a function that takes another argument and call it with diff args depending on the element (Defeating the 'generic' purpose) or instead of having the display property set for every element in the css file, to have one class for the display properties and just check the .className property to see which display class it belongs.
I am just not sure which is the best way to proceed.
Best Regards
NooK