Jquery getting killed by jquery.
Here are two bits of scripts I'm useing to display & save location of my portlets on the dragable plugin.
First is the main event.
- <script>
$(function() {
$( ".column" ).sortable({
connectWith: ".column",
});
$( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
.find( ".portlet-header" )
.addClass( "ui-widget-header ui-corner-all" )
.prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
.end()
.find( ".portlet-content" );
$( ".portlet-header .ui-icon" ).click(function() {
$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});
$( ".column" ).disableSelection();
});
$('#clicksave').click(function() {
$(".column#left").each(function() {
var dataString = '&order=' + $(this).sortable("toArray");
$.ajax({
type: "POST",
url: "core.php?func=sortorderleft",
data: dataString,
success: function() {
$('#message').load("")
.append("")
.hide()
.show(function() {
$('#message').append("");
});
}
});
});$(".column#right").each(function() {
var dataString = '&order=' + $(this).sortable("toArray");
$.ajax({
type: "POST",
url: "core.php?func=sortorderright",
data: dataString,
success: function() {
$('#message').load("")
.append("")
.hide()
.show(function() {
$('#message').append("");
});
}
});
}); });
</script>
Second is the portlet's content being loaded via jquery load.
- <script type="text/javascript">
$('<?php echo $find; ?>').html('<p><img src="includes/loaderimage.gif" width="220" height="19" /></p>');
$("#<?php echo $find; ?>").load("widgets.php?func=<?php echo $find; ?>");
</script>
both these scripts work, but together, the saving function of the top script is killed. Any ideas why?