Title: Add slider with javascript
Last modified: August 30, 2016

---

# Add slider with javascript

 *  Resolved [abdfahim](https://wordpress.org/support/users/abdfahim/)
 * (@abdfahim)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/add-slider-with-javascript/)
 * Is it possible to add slider to page using javascript?
 * So, let say I have a button X. Whenever a person click on that button, I want
   to add [metaslider id=1577] to a certain DIV. Is it possible?
 * [https://wordpress.org/plugins/ml-slider/](https://wordpress.org/plugins/ml-slider/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [matchalabs](https://wordpress.org/support/users/matchalabs/)
 * (@matchalabs)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/add-slider-with-javascript/#post-6748195)
 * Hi there,
 * This would be possible with custom javascript but it isn’t an option within Meta
   Slider.
 * Your best bet might be to load Meta Slider onto the page as usual but hide it
   with CSS, then use the javascript to ‘move’ the slider to another location that
   is visible.
 * Thanks,
    Dave
 *  Thread Starter [abdfahim](https://wordpress.org/support/users/abdfahim/)
 * (@abdfahim)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/add-slider-with-javascript/#post-6748196)
 * Thanks a lot for your response.
 * So, if I have say, 20 buttons to load 20 slider, are you suggesting to load all
   those 20, or I can some how load one and then change the metaslider id?
 * Also, (not sure if I should open a new thread) is it possible to change the width
   and height run time? Or mention width in percentage (so that it always fill the
   parent)?
 * Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Add slider with javascript’ is closed to new replies.

 * ![](https://ps.w.org/ml-slider/assets/icon.svg?rev=3523572)
 * [Slider, Gallery, and Carousel by MetaSlider - Image Slider, Video Slider](https://wordpress.org/plugins/ml-slider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ml-slider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ml-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/ml-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ml-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ml-slider/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [abdfahim](https://wordpress.org/support/users/abdfahim/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/add-slider-with-javascript/#post-6748196)
 * Status: resolved