erik-krogh / SudoSlider

The most versatile jQuery content slider
36 stars 24 forks source link

How do I embed html without having to create an html page? #48

Closed johngoad1 closed 8 years ago

johngoad1 commented 8 years ago

I want to be able to pull content from a data source and then pass it as html:

ajaxSlides = [ '

This is just some text 1!

", '

This is just some text 2!

", '

This is just some text 3!

", '

This is just some text 4!

" ];

var sudoSlider = $(mainSlider).sudoSlider({ ajax: ajaxSlides , numeric: true });

When I do this, it always creates an image tag and sets the src equal to my html!

johngoad1 commented 8 years ago

Sorry, my html got encoded:

I want to be able to pull content from a data source and then pass it as html:

AjaxSlides = [ '<p><img src="../images/image1.jpg" /> Just some text 1!</p>', '<p><img src="../images/image2.jpg" /> Just some text 2!</p>', '<p><img src="../images/image3.jpg" /> Just some text 3!</p>', '<p><img src="../images/image4.jpg" /> Just some text 4!</p>', '<p><img src="../images/image5.jpg" /> Just some text 5!</p>', ];

var sudoSlider = $(mainSlider).sudoSlider({ ajax: ajaxSlides , numeric: true });

When I do this, it always creates an image tag and sets the src equal to my html!

webbiesdk commented 8 years ago

AjaxSlides takes URL's of stuff that SudoSlider should load. What you should do instead is make some other JavaScript to put your html into the slider, before initializing SudoSlider.