Change width of scroll buttons

Home Forums Older releases 1.0.x + Bootstrap addon Change width of scroll buttons

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2708
    lookingforit
    Participant

    Hi,

    I am using smart menu to replace the select tag.

    I am trying to increase the width of span with up and down arrows but it is not increasing. I am using the following code

    
    $('#menu-id').bind('show.smapi', function(e, menu) {
        $("span.scroll-down, span.scroll-up").css({"width":"1000px"});
    });
    

    Is there a setting or some function to get this done ?

    Thanks

    #2709
    admin
    Keymaster

    Hm, when I test this on the default demo page “bootstrap-navbar.html”, it works fine. Make sure you are calling it after #menu-id is available in the DOM.

    BTW, if you don’t need dynamic values, just use CSS – e.g. like this:

    #menu-id span.scroll-down, #menu-id span.scroll-up {
    	width: 1000px !important;
    }

    !important is needed because the script tries to set the width dynamically and we need to override it.

    If you are still having troubles, please post an URL to some kind of demo page where I could test the issue. Thanks!

    #2713
    lookingforit
    Participant

    Thanks for your help.

    I tried it but the width will change dynamically so I changed it in javascript on line 789. I added the following part of code to css property of element

    
    minWidth: subW-(parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0) 
    

    The full line of code is

    
    $sub.dataSM('scroll', {
    								step: 1,
    								// cache stuff for faster recalcs later
    								itemH: itemH,
    								subH: subH,
    								arrowDownH: this.getHeight($sub.dataSM('scroll-arrows').eq(1))
    							})
    							.bind(getEventsNS([
    								['mouseover', function(e) { self.menuScrollOver($sub, e); }],
    								['mouseout', function(e) { self.menuScrollOut($sub, e); }],
    								['mousewheel DOMMouseScroll', function(e) { self.menuScrollMousewheel($sub, e); }]
    							], eNS))
    							.dataSM('scroll-arrows').css({ top: 'auto', left: '0', marginLeft: x + (parseInt($sub.css('border-left-width')) || 0), width: subW - (parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0), minWidth: subW-(parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0) ,zIndex: $sub.css('z-index') })
    								.eq(horizontalParent && this.opts.bottomToTopSubMenus ? 0 : 1).show();
    

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Register

You will be emailed a link to set your password.

Login

Lost password?