Troubleshoot Discuz and jquery incompatibilities--drop-down list not available (uncaught typeerror:cannot set property ' position ' of undefined)

Source: Internet
Author: User

Problem Description:

Recently learned to use Discuz to imitate a portal site, inside to the navigation bar to make a sliding effect, to use jquery, will use jquery reference to Header.htm, as shown in:

However, since Discuz uses PHP and its own mechanism, the $ in jquery will conflict with the Common.js and forum.js of Discuz itself, resulting in the following error causing the drop-down list

Workaround:

Workaround: Redefine jquery's $, for example, I will use JQ to represent jquery's $

At the end of the Jquery-1.7.2.js, add the following code:

var jq = $.noconflict (); //Use the Noconflict () method to specify a new name for the jQuery variable

Because I also used $ in header.htm, to change it to JQ, as follows:

Also to change the reference to the other JS in the $ to JQ, change the Jquery.movebg.js file as shown:

This solves the problem as shown in the following:

Troubleshoot Discuz and jquery incompatibilities--drop-down list not available (uncaught typeerror:cannot set property ' position ' of undefined)

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.