Bug Tracker

Modify

Ticket #11075 (closed bug: invalid)

Opened 2 years ago

Last modified 7 months ago

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:
Blocking: Blocked by:

Description

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

comment:1 Changed 2 years ago by sindresorhus

  • Owner set to MicWit
  • Status changed from new to pending

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 2 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from pending to closed
  • Component changed from unfiled to manipulation

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

comment:3 Changed 2 years ago by dmethvin

  • Status changed from closed to reopened
  • Resolution invalid deleted

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 2 years ago by dmethvin

  • Status changed from reopened to pending

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

  • Status changed from pending to closed
  • Resolution set to invalid

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 7 months ago by junchen27

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.