Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I had the need to not display certain ads when browser dropped below a certain width. I could hide the blocks with the css of "display: none;" but then the impression was still being counted. So I updated the simpleads.cycle.js to check to see if the containing block had a display attribute value of 'none', and if so, then not call the impression callback. I'm posting a patch here in case this is useful to anyone - it may be a bit specific in nature for general use, but I'm happy to refactor if anyone has the need.
Comment | File | Size | Author |
---|---|---|---|
simpleads-no-impressions-for-display-none-blocks-201505232028.patch | 1.14 KB | foxtrotcharlie | |
Comments
Comment #1
minnur CreditAttribution: minnur as a volunteer commented