Closed waitingmyself closed 10 years ago
The init method already takes an "options" object, which can have a "lines" property to overwrite the default setting.
thanks for your reply,but if in one page, i have some elements with different lines to show , what should i do? like this?
$('.trunk8_1').trunk8(); $('.trunk8_2').trunk8({lines:2});
i have try to do like this :
$('.trunk8').trunk8({ lines : $(this).attr('trunk8_lines') || 1 });
but it not worked well
any other better way?
I guess it would make sense to support data attributes to configure trunk8 settings. If you'd like, submit a pull request to handle any data-trunk8-* attribute that will overwrite the corresponding setting. It should not take precedence over the options object in init. It should work for any setting name.
In lieu of that, the second approach looks like the best way to go.
To set a different lines for element