{"id":14730,"date":"2022-10-08T22:32:38","date_gmt":"2022-10-08T17:02:38","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/"},"modified":"2022-10-08T22:32:38","modified_gmt":"2022-10-08T17:02:38","slug":"solved-javascript-not-working-with-jquery-library-1-9-1","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/","title":{"rendered":"[Solved] Javascript not working with jquery library 1.9.1"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-18788360\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"18788360\" data-parentid=\"18788282\" data-score=\"1\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>FIRST, try this<\/p>\n<p>JAVASCRIPT &#8211; Part 1<\/p>\n<pre><code>$(document).ready(function () {\n    $('a.head').click(function () {\n        var a = $(this);\n        var section = a.attr('href');\n        section.removeClass('section');\n        $('.section').hide();\n        section.addClass('section');\n        if (section.is(':visible')) {\n            section.slideToggle(); \/* ===== &lt;-- 400 is the default duration ===== *\/\n        } else {\n            section.slideToggle();\n        }\n    });\n});\n<\/code><\/pre>\n<p>JAVASCRIPT &#8211; PART 2<\/p>\n<pre><code>$(document).ready(function () {\n    $('.rate_widget').each(function () {\n        var widget = $(this);\n        var out_data = {\n            widget_id: widget.attr('id'),\n            fetch: 1\n        };\n        $.post(\n            '--Ratings\/ratings.php',\n        out_data,\n\n        function (INFO) {\n            widget.data('fsr', INFO);\n            set_votes(widget);\n        },\n            'json');\n    });\n\n    $('.ratings_stars').hover(function () {\n        $(this).prevAll().andSelf().addClass('ratings_over');\n        $(this).nextAll().removeClass('ratings_vote');\n    }, function () {\n        $(this).prevAll().andSelf().removeClass('ratings_over');\n        set_votes($(this).parent());\n    });\n\n    $('.ratings_stars').bind('click', function () {\n        var star = $(this);\n        var widget = star.parent();\n        var clicked_data = {\n            clicked_on: star.attr('class'),\n            widget_id: star.parent().attr('id')\n        };\n        $.post(\n            '--Ratings\/ratings.php',\n        clicked_data,\n\n        function (INFO) {\n            widget.data('fsr', INFO);\n            set_votes(widget);\n        },\n            'json');\n    });\n\n});\n\nfunction set_votes(widget) {\n\n    var avg = widget.data('fsr').whole_avg;\n    var votes = widget.data('fsr').number_votes;\n    var exact = widget.data('fsr').dec_avg;\n\n    console.log('and now in set_votes, it thinks the fsr is ' + widget.data('fsr').number_votes);\n\n    widget.find('.star_' + avg).prevAll().andSelf().addClass('ratings_vote');\n    widget.find('.star_' + avg).nextAll().removeClass('ratings_vote');\n    widget.find('.total_votes').text(votes + ' votes recorded (' + exact + ' rating)');\n}\n<\/code><\/pre>\n<p>JAVASCRIPT &#8211; PART 3<\/p>\n<pre><code>$(function () {\n    $('input.field').focus(function () {\n        if (this.title == this.value) {\n            this.value=\"\";\n        }\n    }).blur(function () {\n        if (this.value === '') { \/* ===== &lt;-- Here ===== *\/\n            this.value = this.title;\n        }\n    });\n    var currentPage = 1;\n    $(document).on('click', $('#slider_profile .buttons_profile span'), function () {\n        var timeout = setTimeout(function () {\n            $(\"img\").trigger(\"slidermove\"); \/* ===== &lt;-- Here ===== *\/\n        }, 100);\n\n        var fragments_count = $(this).parents('#slider_profile:eq(0)').find('.fragment_profile').length;\n        var fragment_width = $(this).parents('#slider_profile:eq(0)').find('.fragment_profile').width();\n        var perPage = 1;\n        var numPages = Math.ceil(fragments_count \/ perPage);\n        var stepMove = fragment_width * perPage;\n        var container = $(this).parents('#slider_profile:eq(0)').find('.con_profile');\n        var firstPosition = 0;\n        var lastPosition = -((numPages - 1) * stepMove);\n        if ($(this).hasClass('next')) {\n            currentPage++;\n            if (currentPage &gt; numPages) {\n                currentPage = 1;\n                container.animate({\n                    'left': firstPosition\n                });\n                return;\n            }\n            container.animate({\n                'left': -((currentPage - 1) * stepMove)\n            });\n        }\n\n        if ($(this).hasClass('prev')) {\n            currentPage--;\n            if (currentPage &lt; 1) {\n                currentPage = numPages;\n                container.animate({\n                    'left': lastPosition\n                });\n                return;\n            }\n            container.animate({\n                'left': -((currentPage - 1) * stepMove)\n            });\n        }\n    });\n});\n<\/code><\/pre>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">7<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Javascript not working with jquery library 1.9.1 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] FIRST, try this JAVASCRIPT &#8211; Part 1 $(document).ready(function () { $(&#8216;a.head&#8217;).click(function () { var a = $(this); var section = a.attr(&#8216;href&#8217;); section.removeClass(&#8216;section&#8217;); $(&#8216;.section&#8217;).hide(); section.addClass(&#8216;section&#8217;); if (section.is(&#8216;:visible&#8217;)) { section.slideToggle(); \/* ===== &lt;&#8211; 400 is the default duration ===== *\/ } else { section.slideToggle(); } }); }); JAVASCRIPT &#8211; PART 2 $(document).ready(function () { $(&#8216;.rate_widget&#8217;).each(function () &#8230; <a title=\"[Solved] Javascript not working with jquery library 1.9.1\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\" aria-label=\"More on [Solved] Javascript not working with jquery library 1.9.1\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[333,3842,388,1189,721],"class_list":["post-14730","post","type-post","status-publish","format-standard","hentry","category-solved","tag-javascript","tag-javascript-framework","tag-jquery","tag-jquery-animate","tag-jquery-plugins"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Javascript not working with jquery library 1.9.1 - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Javascript not working with jquery library 1.9.1 - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] FIRST, try this JAVASCRIPT &#8211; Part 1 $(document).ready(function () { $(&#039;a.head&#039;).click(function () { var a = $(this); var section = a.attr(&#039;href&#039;); section.removeClass(&#039;section&#039;); $(&#039;.section&#039;).hide(); section.addClass(&#039;section&#039;); if (section.is(&#039;:visible&#039;)) { section.slideToggle(); \/* ===== &lt;-- 400 is the default duration ===== *\/ } else { section.slideToggle(); } }); }); JAVASCRIPT &#8211; PART 2 $(document).ready(function () { $(&#039;.rate_widget&#039;).each(function () ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-08T17:02:38+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Javascript not working with jquery library 1.9.1\",\"datePublished\":\"2022-10-08T17:02:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\"},\"wordCount\":28,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"javascript\",\"javascript-framework\",\"jquery\",\"jquery-animate\",\"jquery-plugins\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\",\"name\":\"[Solved] Javascript not working with jquery library 1.9.1 - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-10-08T17:02:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Javascript not working with jquery library 1.9.1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Javascript not working with jquery library 1.9.1 - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Javascript not working with jquery library 1.9.1 - JassWeb","og_description":"[ad_1] FIRST, try this JAVASCRIPT &#8211; Part 1 $(document).ready(function () { $('a.head').click(function () { var a = $(this); var section = a.attr('href'); section.removeClass('section'); $('.section').hide(); section.addClass('section'); if (section.is(':visible')) { section.slideToggle(); \/* ===== &lt;-- 400 is the default duration ===== *\/ } else { section.slideToggle(); } }); }); JAVASCRIPT &#8211; PART 2 $(document).ready(function () { $('.rate_widget').each(function () ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/","og_site_name":"JassWeb","article_published_time":"2022-10-08T17:02:38+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Javascript not working with jquery library 1.9.1","datePublished":"2022-10-08T17:02:38+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/"},"wordCount":28,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["javascript","javascript-framework","jquery","jquery-animate","jquery-plugins"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/","url":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/","name":"[Solved] Javascript not working with jquery library 1.9.1 - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-10-08T17:02:38+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-javascript-not-working-with-jquery-library-1-9-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Javascript not working with jquery library 1.9.1"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/14730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=14730"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/14730\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=14730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=14730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=14730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}