PDA

View Full Version : Show/Hide element doesnt work well with css?



TommyMaintz
29 Dec 2006, 4:32 AM
Maybe im just being very stupid cause its early but i think your show function has a bug if the mode is DISPLAY

css:

#content div {
overflow: auto;
position: absolute;
display: none;
}

js:

console.log($(this.vars.currentPage).isVisible());
$(this.vars.currentPage).show();
console.log($(this.vars.currentPage).isVisible());

both give false so the show function doesnt set the display to block is the originalDisplay is on none.


setDisplayed : function(value) {
if(typeof value == 'boolean'){
value = value ? this.originalDisplay : 'none';
}

he uses originalDisplay instead of 'block'.

an option is to dont set them in css and hide all the others except for this one but thats a bit overdone if you could set them to block in the first place in css.

maybe im looking over some stupid mistake or function but could you please tell me if i am?

jack.slocum
29 Dec 2006, 10:32 AM
That was the original intent of "autoDisplayMode". However, just setting it to block causes crashes in Safari (all the time) and browser lockups in FireFox with table elements. In the end, I decided to scrap the idea for now.

For display mode, you have to set your desired display property, e.g.

setDisplayed('block')

or enableDisplayMode('block') then show and hide.

TommyMaintz
29 Dec 2006, 11:04 AM
tnx for your reply. i get the problem...