简体   繁体   中英

How do I open a page in ibox with javascript?

I'm using ibox.js taken from web http://www.enthropia.com/labs/ibox/download.php .

I'd like to open a page to the ibox with javascript.

$j(".refresh").click(function() {
    $j('#case_01').attr('rel': 'ibox', 'href': 'case_01.html);
});

Thank you for your help.

if you use jquery .attr() ,try this

$(".refresh").click(function() {
         //$j('#case_01').attr('rel': 'ibox', 'href': 'case_01.html);
          $('#case_01').attr('rel','ibox').attr('href','case_01.html');
});

You can set multiple attrbiutes using object literal syntax. Currently is not set correctly and you have a typo.

This should work:

$j(".refresh").click(function() {
    $j('#case_01').attr({rel: 'ibox', href: 'case_01.html'});
});

Note:

" When setting multiple attributes, the quotes around attribute names are optional.

WARNING: When setting the 'class' attribute, you must always use quotes!

jQuery prohibits changing the type attribute on an or element and will throw an error in all browsers. This is because the type attribute cannot be changed in Internet Explorer. "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM