Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script not working in Chrome

Featured Replies

Hi guys,

 

I found this odd failure in the script, but I can't figure out why the script isn't running correctly in Chrome! It does run in IE and Firefox, what already is strange huh?

 

Here is my test page for the code: http://rowruffdesign.nl/tutorial/test/

 

I got the script from: http://www.script-tutorials.com/pinterest-like-script-step-1/

 

I wanted to give this a try :D

 

It only works after you pressed on Comment on one of the pins, but that isn't a good solution of course.

I tried to load the function on page load, but that didn't work!

 

Here is the code that should deal with it:

 

$(document).ready(function() {

    // masonry initialization
    $('.mainContent').masonry({
        // options
        itemSelector : '.pin',
        isAnimated: true,
        isFitWidth: true
    });

    // onclick event handler (for comments)
    $('.comment_tr').click(function () {
        $(this).toggleClass('disabled');
        $(this).parent().parent().parent().find('form').slideToggle(250, function () {
            $('.mainContent').masonry();
        });
    }); 

});

 

Cheers :D

Edited by Row

  • Author

I found out when resizing the page, the script also runs! So I guess Chrome is just doing stupid to me :angry:

 

Now I need to figure out how to runs this script after all elements load!

  • Author

Fixed :D

 

Oeps, it turned out I had to include my JS at the end of my file instate on the top in my header!

  • 3 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.