2

I have a Joomla 1.5.26 site here and I am trying to make modal window take specific href on close. Looking into modal.js file, I found this part of code... this.btnClose = new Element('a', {id:'sbox-btn-close', href:'#', title:'Close'}); I am changing the href:'#' to href:'index.php' for example, but nothing happens! When I close modal window doesn't get index.php. Any idea? Thank you for your time!

DNA180
  • 266
  • 1
  • 7
  • 28

1 Answers1

3

Modal library used in Joomla is SqueezeBox

I advice against modifying Joomla core libraries. You should use Squeezebox API instead: add a listener to close event:

SqueezeBox.addEvent('onClose', function() {
    window.location = 'index.php';
});

Modal window might be by other means like by outside out it.

the element <a id="sbox-btn-close" href="#" /> is just an UI element that observes clicks but it's native functionality is suppressed (doesn't work like link).

If you are asking yourself, why it's <a href="#" /> and not <span />, the trick is to show a pointer cursor when you point mouse over it - without using CSS.

piotr_cz
  • 8,755
  • 2
  • 30
  • 25
  • 2
    You can do lot's of interesting stuff with SqueezeBox. – piotr_cz Mar 23 '13 at 14:48
  • 1
    Do you have something like tutorial, guide or anything? – DNA180 Mar 23 '13 at 15:23
  • 2
    For starting links to: [SqueezeBox manual](http://digitarald.de/project/squeezebox/), [MooTools Class: Events](http://mootools.net/docs/core/Class/Class.Extras#Events), When you add in your Joomla template ``, all links with class `modal` will open in SqueezeBox. You may define modal size, load Ajax and so on. – piotr_cz Mar 23 '13 at 16:03
  • 1
    Thank you very much my friend! Please take a look what I made [here](http://stackoverflow.com/questions/15430218/article-open-in-modal-window-after-a-user-click-on-facebook-share-link-and-come) and tell me your opinion. Look straight on the acceptable answer. If you have any correction or something please let me know!!! Thank you for your time! – DNA180 Mar 23 '13 at 16:13
  • @piotr_cs: One more thing my friend. How can I add the option, don't close if someone click outside modal? Thank you for your time! – DNA180 Apr 10 '13 at 10:36