Hi guys, I've got the following algorithm and it's not doing what it should (at least in my mind).
Imagine that I have 6 elements each with 100% height of the window. This algorithm is supposed to change the height of each element to then display the desired one.
Question
Tanoru
Hi guys, I've got the following algorithm and it's not doing what it should (at least in my mind).
Imagine that I have 6 elements each with 100% height of the window. This algorithm is supposed to change the height of each element to then display the desired one.
$(document).ready(function() { function tabs(y) { if(y == 1) { $('#news_panel').css({'height':'100'}); } if(y == 2) { } if(y == 3) { } if(y == 4) { } if(y == 5) { } } $('#quests').click('mousedown',tabs(1)); $('#guides').click('mousedown',tabs(2)); $('#tasks').click('mousedown',tabs(3)); $('#links').click('mousedown',tabs(4)); $('#options').click('mousedown',tabs(5)); });Right now that code there is resizing the news_panel when the page loads, shouldn't it be waiting to be told when to do that by the if statement?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts