orion3dgames / gridder

A jQuery plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images.
http://orion3dgames.github.io/gridder/
461 stars 130 forks source link

Possible conflict #36

Closed joneslafuente closed 8 years ago

joneslafuente commented 8 years ago

Hi

Using the callback function I have managed to integrate an accordion inside the gridder panel. Works very well. What I now want to be able do is use a jquery function that changes font attributes such as opentype features (kerning) etc. Inside gridder it isn't working but is if I place it outside.

Is there anything I need to be doing re. callback. Does it need to be inside a callback function within the accordion which is in itself inside the gridder callback. Apologies but I am not a programmer but am helping out a colleague and this is pushing my knowledge rather a bit. At least I am learning something.

Many thanks

Brian

orion3dgames commented 8 years ago

Hello. Now worries, let see if I can help you.

The reason for this is because the content get created dynamically in the dom so jQuery does not know what to do.

Any plugins you wanna launch in the gridder needs to be launch with the onContent callback like this:

$(".gridder").gridderExpander({
    onContent: function(){
        console.log("Gridder Content Loaded");
        $(".carousel").carousel();
     }
});

In the case you are trying to attach a jquery click event on a button inside the gridder content, you can also use the on delegation function, it will then create a listener than will trigger whenever the button is added to the dom.

$(".gridder-show").on('click', '.myButtonInsideTheGridderContent', function(){
    console.log('Hello World.');
});
joneslafuente commented 8 years ago

Hi, Thanks, works perfectly for a button, just need to work out how to use it for drop down menus (select) that then change the css immediately. Have used a change function but not sure if that is what I need. Ideally a select menu with 4 options, each changing the css of a piece of text.

Thanks again

Brian

orion3dgames commented 8 years ago

If you are trying to do some sort of text editor, why not use a pre-existant one? like this one: http://alex-d.github.io/Trumbowyg/ ??