Home › Forums › JavaScript › Small jQuery plugin dilemma › Reply To: Small jQuery plugin dilemma
August 26, 2014 at 4:51 pm
#180795
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)