As I understand it, you want to show a div
element containing the gallery when Show Gallery is pressed – otherwise to hidden.
This can be accomplised with a couple of jQuery lines:
$( ".show" ).click(function() {
$( ".gallery" ).addClass( "display" );
});
With the appropriate CSS. See jsfiddle
Be sure to remember to include jquery in your theme if it doesn’t contain it otherwise.
Related Posts:
- How to use php code in javascript
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- is there something like isset of php in javascript/jQuery?
- How do I refresh a DIV content?
- Only on Firefox “Loading failed for the script with source”
- Ajax success function
- AJAX not Working with php as supposed
- How to prevent the “Confirm Form Resubmission” dialog?
- jQuery append() vs appendChild()
- ReferenceError: $ is not defined
- Cannot read property ‘push’ of undefined when combining arrays
- How to deal with net::ERR_SSL_PROTOCOL_ERROR?
- Check if checkbox is checked with jQuery
- Getting Error “Form submission canceled because the form is not connected”
- Is there a link to the “latest” jQuery library on Google APIs?
- Change Background color (css property) using Jquery
- jQuery get textarea text
- How can jQuery deferred be used?
- Uncaught TypeError : cannot read property ‘replace’ of undefined In Grid
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- Disable/enable an input with jQuery?
- Get class name using jQuery
- What does on() in JavaScript do?
- jQuery animate backgroundColor
- Use images like checkboxes
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- ChangeDate – Date Picker Bootstrap
- Uncaught TypeError: Cannot read property ‘msie’ of undefined
- How to hide a div with jQuery?v
- How do I pass variables and data from PHP to JavaScript?
- How do I set/unset a cookie with jQuery?
- How to convert selected HTML to Json?
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- How to update array value javascript?
- How to move an element after another element using JS or jquery?
- Why is the jquery script not working?
- JQuery Datatables : Cannot read property ‘aDataSort’ of undefined
- TypeError: $(…).DataTable is not a function
- jQuery explode string like PHP
- Validate date in dd/mm/yyyy format using JQuery Validate
- Simulate Keypress With jQuery
- Adding options to a
- jQuery Ajax POST example with PHP
- Setting and getting localStorage with jQuery
- How to get current date in jQuery?
- Print the contents of a DIV
- How to Scroll Down – JQuery
- Javascript isnull
- Set value to currency in
- HTML Entity Decode
- jquery beforeunload when closing (not leaving) the page?
- How do I pass the this context to a function?
- Escaping HTML strings with jQuery
- jQuery – Dynamically Create Button and Attach Event Handler
- How to use z-index in svg elements?
- What is the best way to detect a mobile device?
- How to filter JSON Data in JavaScript or jQuery?
- Highlight a word with jQuery
- Get querystring from URL using jQuery [duplicate]
- jQuery checkbox change and click event
- jQuery selectors on custom data attributes using HTML5
- TypeError: abc.getAttribute is not a function
- jQuery sort elements using data id
- How to fire an event on class change using jQuery?
- navigator.geolocation.getCurrentPosition sometimes works sometimes doesn’t
- Uncaught SyntaxError: Unexpected token with JSON.parse
- How to open a Bootstrap modal window using jQuery?
- window.location.replace() not working to redirect browser
- How should I initialize jQuery?
- How to reload page every 5 seconds?
- jquery to validate phone number
- Closing Bootstrap modal onclick
- Fire oninput event with jQuery
- What’s a Good Javascript Time Picker?
- Cannot read property ‘preventDefault’ of undefined in javascript error
- WordPress Bootstrap Handburger Menu Wont Open
- WordPress 5.5 – ReferenceError: commonL10n is not defined error
- Ajax Load More Posts in Category Page
- How to use WordPress (PHP) functions in AngularJS partials files?
- How to test nonce with AJAX – Plugin development
- Slider loading issue
- Jquery function working in Chrome Console but not in the code [closed]
- How to add a do_action on refreshing of WP customizer?
- Add / Update Custom Fields After Select Pictures in Media Window
- Error – ‘create_function is deprecated’ [closed]
- Why i can’t get custom fields value or post ID via Ajax?
- Getting a variable inside foreach from PHP to JS after localization
- Accessing an API with jQuery and AJAX
- Replacing WordPress Icons (menu,icons32, etc)?
- Change each text after 4 second and each image after 2 second
- Putting custom html/js page into Elementor as it’s own block
- wp post_tag change minlength
- How to locate the js code and php code for certain function?
- Add other class content with reference class value
- Link to Lightbox Image-Group from Menu?
- How to call a function from functions.php with ajax?
- number of posts with “Load More”
- Add a downloaded JS file to WordPress
- Why this plugin is not working?
- Trying to fix multiple category drop down