I’m working on a Joomla website with a slider in it. I’m using {loadposition slider1}, to get the slider (slider 1) in an article. There is a text link beneath the slider. Now I’d like the page to load another slider (slider 2), in the position of slider 1 when someone hovers over the text link. So visitors hovering the link will see slider 2 in stead of slider 1 when hovering the link.
Can I do this by using javascript? I haven’t been able to find a solution. I hope someone can help me with this problem. Thanks in advance.
In Joomla! the
{loadposition slider1}tag in articles is processed by a content plug-in when an event is triggered. UsuallyonContentPrepareor similar event. The important part of this is that it’s all done on the server before it reaches the users browser.As it’s processed in the article there is no way to call the server again and request just
slider 2…To swap in your
slider2would require the browser to already have it available. To achieve this you could have{loadposition slider2}in a<div>or other element in the article that is set todisplay:none. eg.NB. this is not necessarily good html…
This means when the browser receives the article html, it contains the element it’s just hidden, then you can use the your javascript to hide
slider1and showslider2when the user hovers over the link.