Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A bit more helpful and complete version of above solution.</p> <p>It even limits the resizing outside of the div too!</p> <p>And the JavaScript is fully commented.</p> <pre><code>// Public Domain // Feel free to use any of the JavaScript, HTML, and CSS for any commercial or private projects. No attribution required. // I'm not responsible if you blow anything up with this code (or anything else you could possibly do with this code). jQuery(function($) { // When the document is ready run the code inside the brackets. $("button").button(); // Makes the button fancy (ie. jquery-ui styled) $("#dialog").dialog( { // Set the settings for the jquery-ui dialog here. autoOpen: false, // Don't open the dialog instantly. Let an event such as a button press open it. Optional. position: { my: "center", at: "center", of: "#constrained_div" } // Set the position to center of the div. }).parent().resizable( { // Settings that will execute when resized. containment: "#constrained_div" // Constrains the resizing to the div. }).draggable( { // Settings that execute when the dialog is dragged. If parent isn't used the text content will have dragging enabled. containment: "#constrained_div", // The element the dialog is constrained to. opacity: 0.70 // Fancy opacity. Optional. }); $("#button").click(function() { // When our fancy button is pressed the stuff inside the brackets will be executed. $("#dialog").dialog("open"); // Opens the dialog. }); }); </code></pre> <p><a href="http://jsfiddle.net/emilhem/rymEh/33/" rel="nofollow">http://jsfiddle.net/emilhem/rymEh/33/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload