Releases: abitgone/jQuery-Plugins
Implement lazy-loading for carousel items
If an item has, or features elements with, a data-src
or data-bg-src
attribute, Carousel will now set the src
or backgroundImage
property of those items as appropriate, to load images only when they're in the previous or next items.
Toggle trigger classes first
Just a very minor update to enable behaviour that mimics a rudimentary tab controller. This works by toggling classes on the trigger set first, then the main target second, meaning classes can be removed from a set which may potentially (definitely, in the case of a tab controller) include the main target, before then applying classes to the main target. An example can be seen at http://abitgone.github.io/jQuery-Plugins/ClassToggle/#ex-tabs.
Fix for situations where more than one radiobutton triggers the same target
Fixes an issue with radiobuttons in situations where more than one radiobutton triggers the same target. This fix fires the active radiobutton's trigger last of all, so that the final state is as expected.
Fixes for toggling using <select> elements
This release addresses two issues with ClassToggle when dealing with <select>
elements:
- ClassToggle now fires only on
change
events - ClassToggle now toggles selected
<option>
elements last
Previously, ClassToggle would only fire on click
events. Code has now been added so that click
events are handled by every element except <select>
elements, which now only respond to change
events.
Finally, in an attempt to alleviate issues encountered by people who use ClassToggle with multiple <option>
elements that have the same target, selected <option>
elements will be handled by the toggle function after all unselected options thus, in most cases, resulting in a desirable final state.
Add support for toggling classes using select elements
This release adds support for toggling classes using <select>
elements. Targets are set using data-classtoggle-target
on individual <option>
elements, and there is also support for overriding the class to set by setting data-classtoggle-class
on each option individually.
This release also brings the code which sets trigger classes into line with the rest of ClassToggle, so that you can now explicitly add and remove classes on triggers using the trigger selector. This can be a useful way of toggling a secondary set of classes on a different set of elements, and the feature will likely be renamed in a 2.0 release to reflect this.
Add support for reverse-toggling with radiobuttons and checkboxes
This release adds support for explicitly reversing the toggle process when using radiobuttons and checkboxes. By using the explicit remove --
prefix on a class name, ClassToggle will remove the class when a checkbox or radiobutton is checked, or add it when a checkbox or radiobutton is not checked.
Fixes for Radiobutton/Checkbox features when there are dashes in the classnames
Bugfix that prevented ClassToggle from working correctly when classnames were not purely alphanumeric.
Support Checkboxes and (groups of) Radiobuttons in ClassToggle
ClassToggle now supports using checkboxes and radio buttons to toggle classes on target elements, in exactly the way that you'd expect: the class will only be added if the input element is checked, and removed if it is unchecked. For radio buttons, all inputs in the group (using the same value in the name
attribute) will be evaluated.
Fix for missing closing bracket
That'll teach me to commit without running tests first. Thanks to @maxdeepfield for catching the offending issue and submitting a pull request.
Fix for referencing carousel items by URL hash fragment
Reset scrollLeft/scrollTop if they are not zero after initialise This commit fixes issue #10. Thanks to @Andrej2.