adding jquery in nop2.7

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 年 前
i am trying to add some jquery  to the root.head
but it seems like it is not recognized
anyone knows what is the problem

my site :
http://mitpachat27.com.yew.arvixe.com/he/


this my root :

 Html.AppendScriptParts("~/Scripts/categroySlider.js"); 

this is my jquery :

$(document).ready(function () {
    $(".block-category-navigation .listbox").slideUp(function () { });
    $(".block-category-navigation").click(function () {
        $(".block-category-navigation .listbox").slideToggle("slow");
    });

  


    $(".block-manufacturer-navigation .listbox").slideUp(function () { });
    $(".block-manufacturer-navigation").click(function () {
        $(".block-manufacturer-navigation .listbox").slideToggle("slow");
    });


    $(".block-recently-viewed-products .listbox").slideUp(function () { });
    $(".block-recently-viewed-products").click(function () {
        $(".block-recently-viewed-products .listbox").slideToggle("slow");
    });

    $(".block-info .listbox").slideUp(function () { });
    $(".block-info").click(function () {
        $(".block-info .listbox").slideToggle("slow");
    });




/*
    $(".block-newsletter .listbox").slideUp(function () { });
    $(".block-newsletter").click(function () {
        $(".block-newsletter .listbox").slideToggle("slow");
    });
    */



    $(".block-popular-tags .listbox").slideUp(function () { });
    $(".block-popular-tags").click(function () {
        $(".block-popular-tags .listbox").slideToggle("slow");
            });

    $(".block-popular-tags .listbox").slideUp(function () { });
    $(".block-popular-tags").click(function () {
        $(".block-popular-tags .listbox").slideToggle("slow");
    });


/*  cursor change to hand   */

    $('.block-category-navigation').hover(function () {
        
        $(this).css('cursor', 'pointer');
        
    }, function () {
      
        $(this).css('cursor', 'auto');
        
    });


    $('.block-popular-tags').hover(function () {

        $(this).css('cursor', 'pointer');

    }, function () {

        $(this).css('cursor', 'auto');

    });
    $('.block-newsletter').hover(function () {

        $(this).css('cursor', 'pointer');

    }, function () {

        $(this).css('cursor', 'auto');

    });
    $('.block-recently-viewed-products').hover(function () {

        $(this).css('cursor', 'pointer');

    }, function () {

        $(this).css('cursor', 'auto');

    });
    $('.block-info').hover(function () {

        $(this).css('cursor', 'pointer');

    }, function () {

        $(this).css('cursor', 'auto');

    });


    $('.block-manufacturer-navigation').hover(function () {

        $(this).css('cursor', 'pointer');

    }, function () {

        $(this).css('cursor', 'auto');

    });
  



});


11 年 前
Try to use Html.AddScriptParts in place of Html.AppendScriptParts and it should work. :D
11 年 前
tnx
could you explain me the diffrence ?
11 年 前
pint12 wrote:
tnx
could you explain me the diffrence ?


Append adds the script in front of the queue, while Add adds the script at the back of the queue. Originally, jQuery is in front of the queue, but when you use Append, you are adding your script before jQuery. And since your script depends on jQuery, it cannot be added before jQuery otherwise errors will be thrown. :D
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.