Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery – Oups, something’s wrong

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27220
    ikses57
    Member

    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

    Code:
    $(document).ready(function()
    {
    $(‘b.close’).click(function()
    {
    $(this).parent().addClass(’empty-app’);
    $(this).prev(‘a’).remove();
    });

    $(‘.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;
    });
    });
    });
    });

    #68214
    JaredAM
    Member

    Do you have a live site somewhere that we could look at?

    #68217
    ikses57
    Member

    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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.