Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

Wednesday, October 3

Animate web buttons (zoom in zoom out)

Exactly not an animation. Use this javascript code to zoom in zoom out buttons on mouse hover.

--- Below is Javascript code ---



function buttonZoom(id){
      var x = Number(document.getElementById(id).width);
      for(var i=x; i<=Number(x+20); i++){
            document.getElementById(id).width = Number(i);
      }
    }
   
    function buttonZoomOut(id){
      var x = Number(document.getElementById(id).width);
      for(var i=x; i>=Number(x-20); i--){
            document.getElementById(id).width = Number(i);
      }
    }


----- Below is JSP Code ---

<embed id="button" type="image/svg+xml" src="" onclick="as();"
onmouseover="buttonZoom(this.id);" onmouseout="buttonZoomOut(this.id);" width="60"/>

Note: Specifying width in jsp embed tag is necessary

Monday, October 1

Creating / Using session : Java Web Project



// NameSpace imports

import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
/* Use openSymphony .jar for above import


//Declaration of Session
private Map session;

//Create setter getter

session = ActionContext.getContext().getSession();

//Use session.put & session.get
session.put(“Id”,userID );
String userId = (String)session.get(“Id”);

Friday, June 3