This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

shrinking a div vertically

 
Maan Suraj
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two divs say, and based on a particular condition, my second div should be shown.
Say if some condition is true ,
then display both the divs,


and if the condition is false,
then shrink the page to display only the first div.

I want to know how can we shrink the page to display only first div
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64184
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't "shrink" the page, you hide the div.

HTML elements can be hidden and show by adjusting the CSS display property.
 
Maan Suraj
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway using jquery methods like hide or something?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64184
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, of course. (How do you think jQuery does it?)


To hide an element with an id of fred:to make it visible:
 
Maan Suraj
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but what if i have to first test a condition and then decide to show the div or not?

can i mix the tags and java script. What i mean by this is,can i do something like below?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64184
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course not. Server-side decisions need to be made in a server-side manner. Just set the CSS when it's a server-side decision. JavaScript or jQuery come into play for client-side decisions.
 
Maan Suraj
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you please elaborate a little more on what you said..specially the lne below

Just set the CSS when it's a server-side decision
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic