hi i am having trouble with resizing can't get id using $(this).attr("id")

<script type="text/javascript">
        $(document).ready(function() {
            $('.text_wrapper').resizable({
                onResize: function(e) {
                var id = $(this).attr("id");

                var parent = $(this).parent();
$('.wrapper').load('modules/web/process-sortable-size.php?height='+ e.data.resizeData.target.css('height') +'&width='+ e.data.resizeData.target.css('width') +'&id='+ id);
                },
                onStop: function(e) {
                }
            });
        });
    </script>

Well, you're calling resizable on the text_wrapper by class. So you're trying to get an id out of a class. I think you need a .each() loop, (jQuery). Either way, I'm pretty sure you need to loop through each dom element of class 'text_wrapper'.

Josh of http://www.StudioJosh.com

its on done now i cheated and added it in the mysql array lol working great :)

?>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#text_wrapper<? echo $id; ?>").resizable({
                onResize: function(e) {
                var id = "<? echo $id; ?>";
$('.wrapper<? echo $id; ?>').load('modules/web/process-sortable-size.php?height='+ e.data.resizeData.target.css('height') +'&width='+ e.data.resizeData.target.css('width') +'&id='+ id);
                },
                onStop: function(e) {
                }
            });
        });
    </script>
<?

thanks for your help anyway mate

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.