What jquery code or plugin would I use to update the position of an element created by a plugin

Posted by Breadtruck on Stack Overflow See other posts from Stack Overflow or by Breadtruck
Published on 2010-04-03T20:03:56Z Indexed on 2010/04/03 20:13 UTC
Read the original article Hit count: 204

I am using a jquery plugin from [ FilamentGroup ] called DateRangePicker.

I have a simple form with two text inputs for the start and end date that I bind the DateRangePicker to using this

$('input.tbDate').daterangepicker({
            dateFormat: 'mm/dd/yy',  
            earliestDate: new Date(minDate),  
            latestDate: new Date(maxDate),  
            datepickerOptions: {  
                changeMonth: true,  
                changeYear: true,  
                minDate: new Date(minDate),  
                maxDate: new Date(maxDate)  
            }  
        }); 

I have a collapsible table above this form that when shown, moves the form and the elements that the daterangepicker plugin is bound to, down lower on the page, but the daterangepicker appears to keep the position from when it was actually created.

What code could I put in the daterangepicker's onShow Callback to update its position to be next to the element is was initially bound to? Or is there some specific jquery method or plugin that I could chain to the daterangepicker plugin so that it will update its position correctly. This would come in handy for some other plugins that I use that don't seem to keep their position relative to other elements correctly either.

© Stack Overflow or respective owner

Related posts about jquery-plugins

Related posts about jQuery