Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8442015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:43:49+00:00 2026-06-10T08:43:49+00:00

I have an Isotope #container div with many .item divs, which can be maximised

  • 0

I have an Isotope #container div with many .item divs, which can be maximised and minimised by a click in their nested .header div. They also minimise automatically when a viewer directly clicks another content div without minimising (clicking the header) the currently maximised one.

Therefore, the Google analytics event tracking is sometimes fired twice: when the viewer does not directly click in the .header div of another .item div – but decides to minimise the currently maximised one by clicking it first, before clicking another.

How should I modify the logic so ever only one click event is registered in my analytics?

$('.header').click(function () { // instead of registering the entire .item div (default use), only its .header div (child div) receives clicks

    var $previousSelected = $('.selected'); // necessary for maximising and minimising

    if ($(this).parent().hasClass('selected')) { // use $(this).parent() - not $(this) - because the .header div is a child of the .item div

        $(this).parent().removeClass('selected');
        $(this).parent().children('.maximised').hide();
        $(this).parent().children('.minimised').show();

        $items.find('.minimised').removeClass('overlay'); // returns all .minimised divs to previous state after the .item is closed again

    } else {

        $previousSelected.removeClass('selected');
        $previousSelected.children('.minimised').show();
        $previousSelected.children('.maximised').hide();

        $(this).parent().addClass('selected');
        $(this).parent().children('.minimised').hide();
        $(this).parent().children('.maximised').show();

        $items.not('.selected').find('.minimised').addClass('overlay'); // adds .overlay on each .item which is not currently .selected

    }

    $container.isotope('reLayout');

    <!-- ga project interest tracking -->

    var clicked = $(this).parent().data('item');
    _gaq.push(['_trackEvent', 'Items viewed', 'Clicked', clicked, null, true]);

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:43:51+00:00Added an answer on June 10, 2026 at 8:43 am

    So, if I understand correctly, you only want to fire the GA tracking when something is maximized:

    $(this).parent().children('.maximised').show(function(){
        _gaq.push(['_trackEvent', 'Items viewed', 'Clicked', clicked, null, true]);
    });
    

    You could also try at the bottom of your .click function:

    if( $(this).parent().children('.maximised').is(':visible') ){
       _gaq.push(['_trackEvent', 'Items viewed', 'Clicked', clicked, null, true]); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have many elements, and isotope works perfectly. Now, when a user click
I'm using the Isotope Plugin. I have an empty container to which I am
OK, I have a page which shows the customer how many Widgets he has.
I am using Metafizzy's Isotope plugin and have it set up to filter using
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Really banging my head with this. I am using isotope http://isotope.metafizzy.co/custom-layout-modes/centered-masonry.html . I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.