最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Nanoscroller showing Cannot read property 'style' of undefined why? - Stack Overflow

programmeradmin1浏览0评论

This is my code

<ul id="selectProfileOptions_IC" class="dropdownToggle_cont" ></ul>

I listed some names under the ul element

i used nanascroller for scroll here is my code

$(".dropdownToggle_cont.nano").nanoScroller({stop: true});
    $(".dropdownToggle_cont").css('height',$(".dropdownToggle").height()).addClass('nano');
    $(".dropdownToggle_cont.nano").nanoScroller();  

it showing error Uncaught TypeError: Cannot read property 'style' of undefined

i am also added my nano.css file .

This is my code

<ul id="selectProfileOptions_IC" class="dropdownToggle_cont" ></ul>

I listed some names under the ul element

i used nanascroller for scroll here is my code

$(".dropdownToggle_cont.nano").nanoScroller({stop: true});
    $(".dropdownToggle_cont").css('height',$(".dropdownToggle").height()).addClass('nano');
    $(".dropdownToggle_cont.nano").nanoScroller();  

it showing error Uncaught TypeError: Cannot read property 'style' of undefined

i am also added my nano.css file .

Share Improve this question edited Aug 27, 2015 at 14:38 Kuppuraj asked Aug 27, 2015 at 14:23 KuppurajKuppuraj 4091 gold badge6 silver badges26 bronze badges 5
  • do $(".dropdownToggle") exist? – Pepo_rasta Commented Aug 27, 2015 at 14:27
  • sorry that is $(".dropdownToggle_cont ") – Kuppuraj Commented Aug 27, 2015 at 14:32
  • Does this one referer to a valid element $(".dropdownToggle").height() ? – Jkike Commented Aug 27, 2015 at 14:51
  • $(".dropdownToggle").height() when i print this lint in to console it shows 0 – Kuppuraj Commented Aug 27, 2015 at 15:10
  • 1 You need to include all the relevant code. – raduation Commented Aug 28, 2015 at 9:21
Add a ment  | 

2 Answers 2

Reset to default 7

This error occurs when, within your .nano element, there's no .nano-content element

This error will occur if already a scroll generated

发布评论

评论列表(0)

  1. 暂无评论