[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Know which handle was used for resizable

Posted on 2010-03-23
2
Medium Priority
?
367 Views
Last Modified: 2012-05-09
I have an area that is using jQuery's .resizable();

The handles are e,se,s.

I have different functions I need to perform based on the which handle was used for resizing. I tried the browser event object by using event.target but it returns the element being resized, not the handle.

Does any one have any ideas of how to know which handle is being used?

Thanks is advance!
0
Comment
Question by:Shaye Larsen
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 28359644

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
	<!--   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> -->
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
	<style type="text/css">
    #resizable { width: 100px; height: 100px; background: beige; }
  </style>
  <script>
  $(document).ready(function() {
  
  	var options={	handles: 'e,se,s'
				,ghost:true 
				,start: function(event, ui) {
					var handle=$(this).css("cursor").split("-")[0];
					$("#handleName").html("Handle: "+handle); 
				}
			};
    $("#resizable").resizable(options);
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div id="resizable"></div>
<div id="handleName"></div>
</body>
</html>

Open in new window

0
 
LVL 1

Author Closing Comment

by:Shaye Larsen
ID: 31706021
Great thinking to use the cursor name! Wonderful solution, thanks!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

611 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question