Not Solved Jquery conflict
#1
Not Solved
Hello there, I released a theme but:
(2010-09-29, 09:27 AM)Anurag Wrote: It looks really good, but I think your jquery for the welcome block is conflicting with mybb as it uses prototype. collapse buttons are no working, editor buttons aren't showing in newthread, new reply.

And he's right. I tried a few changes, but they didn't work! In your opinion how could i fix them? In header_welcomeblock_guest there's this code:


<script src="images/mynic/javascripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
        $(document).ready(function() {

            $(".signin").click(function(e) {
                e.preventDefault();
                $("fieldset#signin_menu").toggle();
                $(".signin").toggleClass("menu-open");
            });

            $("fieldset#signin_menu").mouseup(function() {
                return false
            });
            $(document).mouseup(function(e) {
                if($(e.target).parent("a.signin").length==0) {
                    $(".signin").removeClass("menu-open");
                    $("fieldset#signin_menu").hide();
                }
            });            

        });
</script>

I need it to make this work:
[Image: ri6v7c.jpg]

Thanks in advance!
[Image: 2lazl1z.jpg]
My Portfolio (Not updated)
Reply
#2
Not Solved
try adding this
<script type="text/javascript" language="javascript">jQuery.noConflict();</script>
after
<script src="images/mynic/javascripts/jquery.js" type="text/javascript"></script>

and change replace "$" sign to "jQuery" in

<script type="text/javascript">
        $(document).ready(function() {

            $(".signin").click(function(e) {
                e.preventDefault();
                $("fieldset#signin_menu").toggle();
                $(".signin").toggleClass("menu-open");
            });

            $("fieldset#signin_menu").mouseup(function() {
                return false
            });
            $(document).mouseup(function(e) {
                if($(e.target).parent("a.signin").length==0) {
                    $(".signin").removeClass("menu-open");
                    $("fieldset#signin_menu").hide();
                }
            });            

        });
</script>
root@TekkieDa: $ ▮
Reply
#3
Not Solved
Oh thank you very much! It works, now i'm releasing the corrected one Wink
[Image: 2lazl1z.jpg]
My Portfolio (Not updated)
Reply
#4
Not Solved
no problem! always happy to help Toungue
root@TekkieDa: $ ▮
Reply
#5
Not Solved
This will shorten the code a little and you don't have to replace all the "$" with Jquery.

jQuery.noConflict();
jQuery(function($) {
\\ jQuery Goes here :P
});
[Image: premium_mybb_themes-500x100.png]
Latest Theme: MiniColor.
Reply
#6
Not Solved
I didn't know that!
thanks Damion!!
root@TekkieDa: $ ▮
Reply
#7
Not Solved
(2010-09-29, 08:21 PM)Anurag Wrote: I didn't know that!
thanks Damion!!

Smile It also removes the need for "$(document).ready(function() {" So helps in more than one way Smile
[Image: premium_mybb_themes-500x100.png]
Latest Theme: MiniColor.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)