Forums

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

Home Forums JavaScript Small jQuery plugin dilemma Reply To: Small jQuery plugin dilemma

#180795
Alen
Participant

I think you’re kind of missing the point of the original question.

I’m not missing anything.

Instead of just using CSS, you’re cloning DOM elements, reading styles, setting styles, all with JavaScript.

I can style each element independently.


// JavaScript
$('.my-cool-pic').stickIt();

// CSS
.my-cool-pic {}
.my-cool-pic.is-fixed {}

The whole point of the plugin is to make something fixed. This way you get both alternatives controlled via CSS.

In my mind:

JavaScript (Interactivity)
CSS (Presentation)