Carousel Plugin hides a few items in the list cause left and right toggle error

Source: Internet
Author: User

1.

General application Scenarios:

Used to quickly toggle the display of the list content, such as the switch to the employee.

It is necessary to search by Department for this kind of situation, and now my practice is to load all the employee lists that the user can view for the first time, select the department and then hide the other employees who are not in the department.

However, after selecting the left and right toggle buttons cannot be clicked or the upper and lower page switching sequence is incorrect.

Reason: The plug-in will be based on the width of each item and the width of the entire container to calculate the display of a few, when we hide a few of them, it seems to be right, but in fact, the page is not reflected in the plug-in calculation results, resulting in the subsequent switching problems, because the hidden item is actually involved in the calculation, The hidden item is not processed in the source code.

Solution:

Incidentally: It's important to view the document

A description of the settings for the items parameter in the document

Set the items parameter to the item you really want to show

My wording:

function () {                var allwidth = $ (". Jcarousel"). Width ();                 var itemwidth = Ul.find ("Li:first"). Outerwidth ();                 = parseint (Allwidth/ itemwidth);            }). Jcarousel ({                items: $ ("#empul li:visible")            });

2, or the above scene, if you can search by name, etc.

When you switch to a page greater than 1, that is, you switch to the second page, the third page and so on, this is the input name to search, there may be empty results, or incomplete results (assuming that the logic code is not a problem), depressed it!

Actually this is you can click on the Pre toggle button to try and be hidden

Solution:

$ ('. Jcarousel '). Jcarousel (' scroll ', 0);

The structure of my page in the case:

<Divclass= "Jcarousel col-md-10 col-sm-10 col-xs-10">        <ulID= "Empul">                           <Li>                                                         </Li>                      </ul>    </Div>

Carousel Plugin hides a few items in the list cause left and right toggle error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.