开发者

Dynamic Elements in JSP?

开发者 https://www.devze.com 2023-04-07 05:15 出处:网络
I am wondering how to create dynamic elements in a JSP webpage? For example, what I 开发者_StackOverflowwant to do is that I have a Selection Box, in which a user selects an image. Upon clicking a but

I am wondering how to create dynamic elements in a JSP webpage? For example, what I 开发者_StackOverflowwant to do is that I have a Selection Box, in which a user selects an image. Upon clicking a button (or possibly after selecting an item), the image will 'slide down' (like how PPT slides slide down when changing slides) and rest on the center of the screen.

Or at least another simpler case would be, when clicking a button, a text box will appear each time you click the button. So far, the only idea I have of this is by using visibility but that will limit me.

Can you help me on how to do these things or if it is possible to do these with only JSP? Additionally, is it possible for elements to 'pop up' (like in facebook photo viewer) without refreshing the page?

Thank you!


You want things to happen on the client, so you need to be focusing on the HTML, CSS and JavaScript. The fact you generate the HTML using JSP is irrelevant.

  1. Build on things that work
  2. Write JS logic for adding new content based on the form options
  3. Write JS logic for manipulating the CSS to do the animation

Consider using a library such as YUI or jQuery to help with the JS, and using CSS 3 Transitions for the animation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号