Skip to main content

Bug Tracker

Side navigation

#11075 closed bug (invalid)

Opened December 20, 2011 12:47PM UTC

Closed January 04, 2012 08:14AM UTC

Last modified September 29, 2013 08:34AM UTC

issue with .clone() in chrome with images

Reported by: MicWit Owned by: MicWit
Priority: low Milestone: None
Component: manipulation Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

When using .clone() to clone an image from one div to another, in chrome, it seems to copy the src and look online again rather than actually just duplicate the image.

For this example, I am making a shop front and downloading all the details at page load. Once they are down, the thumbnails are downloaded (into hidden divs) with 400 in a grid on a jpeg file. Once each one is downloaded or the position in the results is changed (and the thumbnails are re-shown), .clone() takes the image out of the correct hidden div, and puts it in the div required, and then has the marginTop and marginLeft edited so it shows the correct thumbnail (the parent div is overflow hidden and the height and width of a thumbnail).

It is working well in ie 7, 8 and 9, firefox (8.0.1 - mac and windows 7) and on the android browser (android 2.3.6 on galaxy s 2). However, it is not working in chrome ( 16.0.912.63 windows 7 and Mac OS) or safari (5.1.1 mac os), they all seem to reload the image for each instance. This to me would indicate that something used in .clone() images is handled differently in WebKit.

Any chance this can be changed to work or is there a way around it?

Attachments (0)
Change History (6)

Changed December 20, 2011 02:14PM UTC by sindresorhus comment:1

owner: → MicWit
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: Open the link and click to "Fork" (in the top menu) to get started.

Changed December 20, 2011 02:27PM UTC by rwaldron comment:2

component: unfiledmanipulation
priority: undecidedlow
resolution: → invalid
status: pendingclosed

This is not a bug, let alone a jQuery bug - this is how the IMG element works

Changed December 20, 2011 02:30PM UTC by dmethvin comment:3

resolution: invalid
status: closedreopened

The OP is reporting that it works differently on webkit than on IE/FF though. We could use a test case to verify that, and also to see if the same behavior occurs when bare DOM functions are used.

Changed December 20, 2011 02:30PM UTC by dmethvin comment:4

status: reopenedpending

Changed January 04, 2012 08:14AM UTC by trac-o-bot comment:5

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!

Changed September 29, 2013 08:34AM UTC by junchen27 comment:6

I have the same question, and i don't know how to fix