- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › jQuery – Oups, something’s wrong
Hi everyone,
Here is my problem
In my new app, you have empty div where you can add an app. When I click on Add an App, a popup fade in and let you choose. The user choose his app, and the link to the app is then clone into the div. Until there, everything is okay. But when you erase the content of the div, if you re-click on Add an App, it duplicates the link added into the div (is it clear?).
I know something is wrong in the second part of the code, when the user select his app. Because the eraser works perfectly. Could you please help me?
Here is the code
$(‘.add-app’).click(function()
{
var linkClicked = $(this);
$(‘#app-store’).fadeIn(function()
{
$(‘#app-store a’).click(function()
{
var userChoice = $(this);
var titleUserChoice = $(userChoice).attr(“title”);
var hrefUserChoice = $(userChoice).attr(“href”);
var appDivSelected = $(linkClicked).parent();
$(appDivSelected).removeClass(’empty-app’);
$(userChoice).attr(“href”, titleUserChoice).attr(“title”, “”).clone().prependTo(appDivSelected);
$(‘#app-store’).fadeOut();
return false;
});
});
});
});
Do you have a live site somewhere that we could look at?
Yes, but only by DM, I’m sorry, because it’s the next product we’re working on. I send you one right now. Sorry for the inconvenience.