Skip to main content

Bug Tracker

Side navigation

#9567 closed bug (invalid)

Opened June 12, 2011 08:33PM UTC

Closed June 28, 2011 07:46AM UTC

jQuery bug with $('#sth').width();

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

I found this bug in jQuery (normal version, NOT iPhone).

On my web browser - Google Chrome or Firefox, it works okay, but the problem comes when i open my site on the iPhone.

The problem is, when I use this piece of code, all the links and clicks on my site seems like they are disabled. Every click is 'denied', 'ignored'.

Here is it:

(function($)

{

$.mouseLoader = function(stngs)

{

settings = jQuery.extend({ bindToAjax: true }, stngs);

if($('#mouseLoader').length == 0)

{

$('body').prepend('<div id="mouseLoader"><img src="/img/ajax-loader.gif" /></div>');

var mouseLoader = $('#mouseLoader');

$(document).bind('mousemove', function(event)

{

var newtop = $(document).scrollTop()+event.clientY+10;

var newleft = $(document).scrollLeft()+event.clientX+10;

if(newleft+mouseLoader.width() > $(document).width()) newleft = $(document).width()-mouseLoader.width();

if(newtop+mouseLoader.height() > $(document).height()) newtop = $(document).height()-mouseLoader.height();

mouseLoader.css({'top': newtop, 'left': newleft});

});

}

if(settings.bindToAjax) jQuery(document).ajaxStart(function(){ $.mouseLoader.show() }).ajaxStop(function(){ $.mouseLoader.hide() });

$.mouseLoader.show = function(hide)

{

$('#mouseLoader').fadeIn();

if(hide) $.mouseLoader.hide(hide)

}

$.mouseLoader.hide = function(hide)

{

setTimeout(function(){ $('#mouseLoader').fadeOut(); }, hide);

}

}

})(jQuery);

The solution I found is by replacing the code on line 10 by this:

var mouseLoader = $('#mouseLoader').get(0);

Attachments (0)
Change History (4)

Changed June 13, 2011 05:42AM UTC by ajpiano comment:1

owner: → anonymous
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsfiddle.net that reproduces the issue experienced to help us assess your ticket.

Additionally, test against the jQuery (edge) version to ensure the issue still exists.

Changed June 13, 2011 05:49PM UTC by anonymous comment:2

status: pendingnew

Sorry, but I don't have enough time for that now... :( Im really busy

Changed June 13, 2011 11:45PM UTC by ajpiano comment:3

status: newpending

So are we :) I'm returning the ticket status back to pending your reply. If you are able to create some sort of tangible test case in the next two weeks, then do so, otherwise the ticket will automatically be closed.

Changed June 28, 2011 07:46AM UTC by trac-o-bot comment:4

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!