Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#11075 closed bug (invalid)

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?

Change History (6)

comment:1 Changed 5 years ago by sindresorhus

Owner: set to 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: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 5 years ago by Rick Waldron

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

comment:3 Changed 5 years ago by dmethvin

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.

comment:4 Changed 5 years ago by dmethvin

Status: reopenedpending

comment:5 Changed 5 years ago by trac-o-bot

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!

comment:6 Changed 4 years ago by junchen27

I have the same question, and i don't know how to fix it...help~

Note: See TracTickets for help on using tickets.