jquery-plugins

using a variable in :contains - how to

纵然是瞬间 提交于 2020-01-05 07:10:36
问题 I am using accordion menu on an e-commerce site. The menu stays open with the options until the product page. On that page I am trying to use the breadcrumbs to match text in the menu and then apply a class to open the menu to the correct category for the page. Here is my code: $(document).ready(function(){ var bctext = $('#ProductBreadcrumb ul li:last-child').prev('li').children().text(); $('ul#accordion a:contains(bctext)').parent().parent().addClass('special'); }); The variable returns the

jQuery plugin authoring in CoffeeScript, with conventionally “private” objects and “prototype” calls

為{幸葍}努か 提交于 2020-01-05 05:40:06
问题 Background So, I came across an article Essential jQuery Plugin Patterns a few months ago. I was trying to write a simple jQuery plugin and I found this article very useful. It contains a lot of information, most of which is beyond my expertise of JavaScript or jQuery. The main thing of interest was the first plugin template, dubbed jQuery Lightweight Plugin Boilerplate , which I referenced in another question a few months ago. Recently, I started using CoffeeScript and looked up for a

jQuery Background Canvas transparency

梦想与她 提交于 2020-01-05 04:31:38
问题 I'm using the jQuery Background Canvas plugin and have created a DIV with rounded corners and a gradient effect. However, I'm unable to get the transparency to work. What am I doing wrong? Here's the JavaScript: $(document).ready(function() { $(".Test").backgroundCanvas(); $(".Test").makeElementTransparent("#CECFCE"); $(".Test").backgroundCanvas(true, "#CECFCE"); }); function DrawBackground() { $(".Test").backgroundCanvasPaint(TestBackgroundPaintFkt); } // Draw the background on load and

refresh grid using inlineNav

家住魔仙堡 提交于 2020-01-05 03:53:06
问题 I am using inlineNav as follows: var inlineparams = { addParams: {useFormatter:false}, editParams: {extraparam: { "action": "ajaxgrid", "subaction": "jqedit", "tableid": "sysbuglist", "sessionid":"fd7c74d8-d3cb-102f-bd56-0015171f0bcc" }}, add:true, edit:true, save:true, cancel:true, aftersavefunc:reloadGrid}; $("#navgrid").jqGrid("inlineNav","#navgrid_bottompager", inlineparams); So, I am using the add, edit, save, cancel buttons on the bottompager. Question: How do I get control after a save

jquery-ui-map fit bounds with a polyline?

点点圈 提交于 2020-01-04 09:03:15
问题 I'm working on a mobile app using jQuery Mobile. I also you the plugin "jquery-ui-map" to do my map (that helped alot with display issues using only GMap with jQM). I'm able to add polyline on the map and it works just fine. But when I try to use the fitBounds method, it doesn't work. In fact, it zoom out alot. But not on my bounds. Here is my code : // Added some data, so you can understand the structure // of variable "plan" plan[0].lat_a = 45.4681; plan[0].lng_a = -73.7414; plan[0].lat_b =

jquery metisMenu not working inside ng-include

て烟熏妆下的殇ゞ 提交于 2020-01-03 19:00:40
问题 I want to use ng-include to render the sidebar of the template. The template requires jQuery metisMenu plugin for dropdowns. Issue : Plugin only works when I load the following scripts inside the partial template 'sidebar.html': <script src="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.0/metisMenu.js"></script> <script>$(function() { $('#side-menu').metisMenu(); });</script> and fails when I try to load them inside index.html . I want to load the plugin only once inside index.html as I may

Using JQuery Sticky Elements

不想你离开。 提交于 2020-01-03 17:37:30
问题 I'm trying to do the classic Sticky Element in reverse. See http://imakewebthings.com/jquery-waypoints/sticky-elements/ for an example of a typical sticky experience. What I want to do instead, is to have an element that initially docks flush with the bottom of the users window, and then stops and docks on the footer when he scrolls down that far. Is there a better way to initialize this plugin, or use another to accomplish this? 回答1: Following the documentation, it can be achieved as follows

Using JQuery Sticky Elements

早过忘川 提交于 2020-01-03 17:36:13
问题 I'm trying to do the classic Sticky Element in reverse. See http://imakewebthings.com/jquery-waypoints/sticky-elements/ for an example of a typical sticky experience. What I want to do instead, is to have an element that initially docks flush with the bottom of the users window, and then stops and docks on the footer when he scrolls down that far. Is there a better way to initialize this plugin, or use another to accomplish this? 回答1: Following the documentation, it can be achieved as follows

jQuery Cookie plug in behavior: is setting domain to “.com” if cookie is session cookie

半腔热情 提交于 2020-01-03 17:29:41
问题 Folks, I've found that the jQuery cookie plugin is setting the domain to ".com" if the cookie I'm setting is a session cookie. Here's the code: jQuery.cookie("currentTab", selectedTab ); If I look at cookies with IE's Developer Tool, it shows the domain as ".com". If I set this way: jQuery.cookie("currentTab", selectedTab, { expires: 1} ); ... then it has "www.sitename.com" as the domain. Is there some trick I'm missing, or have I found a bug? Thanks. 回答1: Well, I've created this http:/

In javascript, how do I remove an element from an array of objects?

我是研究僧i 提交于 2020-01-03 17:26:12
问题 In javascript, how do I remove an element from an array of objects? Here is the code: $.fn.mapImage.deletePinpoint = function(image, pinpoint){ var deleted = false; for (var i = 0; i < image.pinpoints.length; i++) { if(image.pinpoints[i].position == pinpoint.position){ image.pinpoints.remove(i); deleted = true; } if(deleted){ image.pinpoints[i].position -= 1; } } $('.edit-mode').find('div.dynamic-pinpoint-area').remove(); $('.edit-mode').find('div.pinpoint-text').remove(); $('.create-mode')