Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI resizable not working at all

Ok here is the problem. jQuery Resizable just does not work on this page: click here

Try it out on the grey box in the upper left corner.

What I want to do is make the shoutbox on the right size resizable. But it didn't work so I tried to just copy everything from the jQuery UI example page into my one and try it out. So I added the grey box the same way they did, using even the same css but it won't work.

Here's how the libraries are called:

 <script src="http://www.google.com/jsapi"></script>
 <script type="text/javascript">

 google.load("jquery", "1.4.1");
 google.load("jqueryui", "1.7.2");

google.setOnLoadCallback(function() {

});

</script>

<script type="text/javascript" src="js/thickbox.js"></script>
<script type='text/javascript' src='js/jqueryEasingMin.js'></script>
<script type='text/javascript' src='js/jquery.imghover-1.1rc.js'></script>
<script type="text/javascript" src="js/shoutbox.js" ></script>
<script type="text/javascript" src="js/bbcode.js" ></script>
<script type='text/javascript' src='js/jqueryLoader2.js'></script>

script inside document ready function (like in example):

 $('#resizable').resizable();

CSS of the grey box:

<style type="text/css">
#resizable { width: 100px; height: 100px; background: silver; position:relative; z-index:15;}
</style>

I had to add the position and z-index parameters because of the design of my site but that seems not to affect anything.

And implementation:

  <div id="resizable"></div>

I think I'm missing something really obvious here but I can't see it. I even tried it with linking the jquery UI libraries to a local directory instead of using google's ones.

I would really appreciate a nod in the right direction. Thank you

like image 727
Cletus Avatar asked Feb 11 '10 23:02

Cletus


3 Answers

You have to include css provided by jquery-ui when you build your custom download. You can find the css file in jquery-ui-1.8.21.custom\css\ui-lightness\jquery-ui-1.8.21.custom.css (if you chosen lightness theme). Here's the css for resizable:

.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
like image 68
Tomasz Sikora Avatar answered Oct 19 '22 16:10

Tomasz Sikora


There is supposed to be this right after calling jquery ui and css:

<script type="text/javascript"> 
$(function() {
    $("#resizable").resizable();
});
</script>

EDIT: Also, you need to include a theme for it to work correctly.

like image 26
tr4656 Avatar answered Oct 19 '22 16:10

tr4656


try adding this:

<div id="resizable" class="ui-widget-content">
like image 1
Dedan Avatar answered Oct 19 '22 16:10

Dedan