| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 8566|Reply: 3
Collapse the left

Use jQuery in Discuz!

[Copy link]
Post time: 2011-12-12 10:19
| Show all posts |Read mode
many web developer use jQuery to make designs more ateractive

but in discuz!X it's not possible to use jQuery, and if jQuery included, site functionality not work good becuse discuz!x use $ as function for id element selection like jQuery that use $ to element selection

if you want use jQuery in discuz!x use notepad++ and search $( in all files and replace theme with another name like __( OR $$( and include jQuery

I LOVE JQUERY

 Russia

Post time: 2011-12-12 11:26
| Show all posts
There is another solution.
I have seen it in the "Gift" plugin for UCHome.
The idea is to use "noConflict" mode of jQuery,
NOT modify the X2 code itself, but modify only YOUR ADDITIONAL CODE:
i.e. replace the standard "$" function in your code with another name, like this:
  1. <script language="javascript" type="text/javascript" src="js/jquery.js"></script>
  2. <script language="javascript" type="text/javascript" >var $$ = jQuery.noConflict();</script>
  3. <script type="text/javascript">
  4. $$(document).ready(function(){
  5.         showList( -1 , 0 );
  6. });
  7. ...
  8. </script>
Copy the Code
 Author| Post time: 2011-12-12 13:25
| Show all posts
that's right, thanks you
Post time: 2011-12-17 05:27
| Show all posts
Edited by riverstore at 2011-12-18 09:09

I get problem on using jQuery's plugin with Discuz X2, the plugin doesn't work. Do I have to change the function sign ($) to the other one?
Please help me. Thanks a lot!
PS: I use this plugin
http://paulirish.com/2009/jquery-idletimer-plugin/
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-24 23:12 GMT+3 , Processed in 0.039550 sec., 9 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list