JS at bottom of a page
-
Hi WP,
I want to add this JS to the bottom of a page. Have tried several ideas, but it does not work. The javascript should allow the user to toggle between a grid and list view. The toggle does not work.
Here is the JS:
function() { $('#list').click(function(event){event.preventDefault();$('#products .item').addClass('list-group-item');}); $('#grid').click(function(event){event.preventDefault();$('#products .item').removeClass('list-group-item');$('#products .item').addClass('grid-group-item');}); };
Here is what I hope to accomplish:
https://bootsnipp.com/snippets/featured/list-grid-view
I have tried removing formating with PS Disable Autoformating Plugin, adding js to footer, adding js to page enclosed is <script> tags, and at the bottom of a page in the JS box.
I am using Bootstrap 3 and the latest WP 4.2.3. Currently on localhost.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘JS at bottom of a page’ is closed to new replies.