vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   CMPS Module & Jquery/Javascript? (https://vborg.vbsupport.ru/showthread.php?t=276344)

TheRealso0sick 01-02-2012 05:59 PM

CMPS Module & Jquery/Javascript?
 
Hi!

I'm trying to implement a jquery plugin
to one of my CMPS Modules.

I've added the HTML code to a BB code Module (very simple code),
the CSS to my main CSS/additional CSS
and added/linked the Jquery/Plugin in my headinclude template.
Though, the Jquery script does not seem to have any effect
on my html code and i can't figure out why.

Is anyone experienced with this and can tell me what i'm doing wrong?
When testing the exact same code on a external page, it worked perfectly fine.

Heres my code:
(The sources are correct btw)

Jquery/JS (in headinclude template)
Code:

<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script src="jquery.kwicks-1.5.1.js"></script>
<script>
$().ready(function() { 
    $('.kwicks').kwicks({ 
        max : 205, 
        spacing : 5 
    }); 
}); 
</script>

HTML (in CMPS BB code module)
Code:

<ul class="kwicks" > 
    <li id="kwick1">1</li> 
    <li id="kwick2">2</li> 
    <li id="kwick3">3</li> 
    <li id="kwick4">4</li> 
</ul>

CSS (in main/additional CSS)
Code:

.kwicks { 
    list-style: none; 
    position: relative; 
    margin: 0; 
    padding: 0; 

.kwicks li{ 
    display: block; 
    overflow: hidden; 
    padding: 0; 
    cursor: pointer; 


.kwicks li{ 
    float: left; 
    width: 125px; 
    height: 350px; 
    margin-right: 5px; 

#kwick1 { 
    background-color: #53b388; 
    background-image: url('../images/meet.gif'); 

#kwick2 { 
    background-color: #5a69a9; 
    background-image: url('../images/kwicks.gif'); 

#kwick3 { 
    background-color: #c26468; 
    background-image: url('../images/for.gif'); 

#kwick4 { 
    background-color: #bf7cc7; 
    background-image: url('../images/jquery.gif'); 
    margin-right: none; 
}

Any help is greatly appreciated!

TheLastSuperman 01-02-2012 08:01 PM

I believe you simply need to tweak it a little for example it has:

Code:

<script>
function code
function code
function code
</script>

Where it should be

Code:

<script type="text/javascript">
function code
function code
function code
</script>


TheRealso0sick 01-02-2012 08:17 PM

Ty for your answer

Yes, i thought of that but it didn't fix it either.
I got it working now though.

What i did was, instead of using a BB Code Module,
i created a new template module and just treated it
like a normal HTML page (<html> <head> <body> etc..)
Placing my script code in the header of this "template" worked fine.


All times are GMT. The time now is 05:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01022 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete