w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Custom JQuery Scrollbar Plugin
Had to change the scrollbar plugin I was using, now I am using SlimScroll (https://github.com/rochal/jQuery-slimScroll). This is the only scrollbar plugin out there that does not builds its div and force it in the container div automatically resizing the content size. SlimScroll is based on Facebook style scrollbar that becomes a part of the parent div. Thanks to all of those who asked for the code! :)

Categories : Javascript

jQuery scrollbar plugin not working on Ajax loaded content
If you're loading elements dynamically after DOM Document is already loaded (like through AJAX in your case) simple binding .scrollbars() to element won't work, even in $(document).ready() - you need to use "live" event(s) - that way jQuery will "catch" dynamically added content: $(selector).live(events, data, handler); // jQuery 1.3+ $(document).delegate(selector, events, data, handler); // jQuery 1.4.3+ $(document).on(events, selector, data, handler); // jQuery 1.7+ Source: jQuery Site

Categories : PHP

Fullcalendar jQuery plugin by Adam Shaw Scrollbar issue
This is a little hacky - I am finding the closest DIV that has a class then traversing to the next div (which has the scrollbars) and enabling niceScroll on that element. It would be easier if the container that scrolled had a class or an ID on it. Once you include nicescroll you can add this to your calendar initialization: viewDisplay: function(view) { $('.fc-agenda-divider').next('div').niceScroll(); } Something like this $('#calendar').fullCalendar({ viewDisplay: function(view) { $('.fc-agenda-divider').next('div').niceScroll(); }) You can see it in action here: http://jsbin.com/ugepus/1/

Categories : Jquery

jQuery pagination plugin doesn't work
I never heard of this plugin before, but it seems to me that the plugin only creates a specified number of page links for you, but it does not automatically show and/or hide content of your site. Is it the first time you use this plugin? To me, it looks like your selector .clients_wrapper is found X times, so X pagination bars are generated by the plugin. I think the plugin works, but it does not do what you expected it to do.

Categories : Jquery

jQuery Form plugin not submitting while using it with the jQuery Validation plugin
You seem to be confusing the functional operation with the initialization of the plugin. Move the .ajaxForm() method out so that it's a sibling of the .validate() method... $(document).ready(function() { $("#creatUser").validate(...); // initialize jQuery Validate plugin $('#creatUser').ajaxForm(...); // initialize Ajax Form plugin }); Then properly leverage the callback functions within... 1) Put only a return false in the submitHandler callback within the .validate() method. $("#creatUser").validate({ // your other options, submitHandler: function(form) { return false; // block submit since another plugin is handling this } }); 2) .valid() is a method from the jQuery Validate plugin that you can call to check the form's validity and get a boole

Categories : Jquery

jquery msg plugin overlay another jquery plugin looped using php
You are causing an error by assigning the same id to multiple elements. An id can only be used once. Hence id: identifier. So you should give the anchors a class and trigger your JS from that. Also, give the elements a unique id, by adding your database id to the element id.

Categories : PHP

Event inside a jquery plugin only uses last selector used by plugin?
This is because $$ is defined as global (window in case of browser) instead of local(due to the absence of var), which causes its value to be of the last element that uses the plugin, overwriting any other previous ones. Just define it with var inside the plugin function and it should work fine. this.each(function () { var $$ = this; //<-- Here $(window).on('scroll', function () { console.log($$); }) }); Demo

Categories : Jquery

How does RequireJS use multiversion jQuery and install jQuery plugin to the right version of jQuery
Finally, I used $.noConflict to remove the one jquery in global, and wrap the plugin in AMD module define function. Although it's not a best practice but it solved my problem.

Categories : Jquery

jQuery detect if form has a value to be submitted and jquery message plugin show
You can check if the input has value using the jQuery .val() method. Using this you have several options: Use it inside a value-changed handler for the textbox and only enable the Submit button when the input has a value Use it within the .submit() event you're already handling. If there isn't a value cancel the submit. As usual, having the server handle this as well is required (in case the form is submitted without javascript).

Categories : Jquery

jQuery DataTables + columnFilter plugin Overflow Issue with jQuery UI Tabs
This seems a bit embarrassing but after some trial and error i found that if you comment out/remove the "sScrollXInner" property it seems to resolve this issue. I'm not sure what other cases this will help with but i guess it seems to work well in conjunction with the following to help force column size re-adjustment: //DataTables property "fnInitComplete": function () { this.fnAdjustColumnSizing(true); } And: //jQuery tab initialisation $("#tabs").tabs({ "show": function (event, ui) { var table = $.fn.dataTable.fnTables(true); if (table.length > 0) { $(table).dataTable().fnAdjustColumnSizing(); } } });

Categories : Jquery

requirejs not exposing local jquery to jquery plugin with shim
I believe the problem is that you are trying to use shim with AMD modules, when really that feature is designed for non-AMD modules. From that section of the documentation: Remember: only use shim config for non-AMD scripts,scripts that do not already call define(). The shim config will not work correctly if used on AMD scripts, in particular, the exports and init config will not be triggered, and the deps config will be confusing for those cases. If you want to keep jQuery out of global scope and still use it with your other modules, you can follow the Mapping Modules to use noConflict approach: If all of your modules (including any third party jQuery plugins or library code that depend on jQuery) are AMD compatible and you want to avoid having $ or jQuery in the global namespac

Categories : Javascript

using jquery datatables plugin in jsf application and data should be populated from jquery
If your intended use is to have extreme amounts of table rows (10,000+) in single instances then Datatables with server side processing is the way to go. Each time you click the pagination or filter it will make a new request to the server for fresh json data. If however the amount of rows is somewhere between 200-10,000 i would use either the javascript array(which could be printed on page load), or the ajax Source option, These to options basically mean all the data is pushed to the client side on the initial datatables draw, but Datatables plugin will append/remove the rows the the dom when required. The first option is just apply datatable object to a normal html table, which might be the fastest to impliment if you allready have the tables there. Due to the initial table row and cel

Categories : Jquery

How to chain jquery plugin option with regular jquery methods?
You'd do that with bracket notation, as that allows variables : $(this).next()[self.options.type](200); // ^^^ string that matches jQuery method, like slideToggle etc

Categories : Jquery

errors when using jQuery Booklet plugin with multiple jQuery libraries
It must be your incomplete src location. It should be something like this, as if running from localhost: <script src="http://localhost/wcsstore/CVWEB/images/home/js/jquery.easing.1.3.js" type="text/javascript"></script>

Categories : Jquery

plugin illuminate 0.7 incompatible to jQuery 1.9.1 or jQuery-UI 1.10.3 -> TypeError: $.css(...) is undefined
Whew, well that took some debugging. The problem is that illuminate assumes that jQuery doesn't support the box-shadow property, but the newer jQuery version does. That means that when vendor prefixes aren't available (which they aren't in the latest FireFox), you get either an infinite loop or an undefined property. Fortunately illuminate went with an undefined property BoxShadow instead of the infinite loop which would have come from using boxShadow (as I found out, leading to several browser hangs). So that's the problem, what's the fix? Strip the offending code from illuminate. All cases of support.boxShadow should be changed to simply 'boxShadow', and the cssHooks.boxShadow block removed. You can also delete the bit which sets support.boxShadow in the first place. My test case is h

Categories : Javascript

Time validation with @jquery validation plugin with bootstrap plugin..
After working for while finally I found the one to solve the problem ...we just can do with the match function along with the pattern of time of jQuery validation plugin. $("input").blur(function() { if (!(this.value.match(/^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i))) { $(this).popover({ html: true, trigger: 'blur', content: function() { return 'Invalid Time'; } }); return false; } else { var form_data = $(this).closest('tr').find('input').serialize(); } $.ajax(

Categories : Jquery

jQuery UI Tooltip with jQuery Validate plugin
As ninja said in the comment I just placed the above code in the errorPlacement function for the validate plugin:- errorPlacement: function(error, element) { element.attr('title', error.text()); $(".error").tooltip( { position: { my: "left+5 center", at: "right center" }, tooltipClass: "ttError" }); }

Categories : Jquery

jQuery nicEdit with jQuery form plugin
Before you can send the data you must store the nicEditor data, so that the text is written in the textarea by nicEditor var NicEditor = nicEditors.findNicEditor('mydata'); var inst = NicEditor.instanceById('mydata'); inst.saveContent();

Categories : Jquery

jQuery 1.10 + jQuery Migrate Plugin - help needed
The migrate plugin can be useful for old applications but in the case of a new application it is much better to avoid using migration plugins. If tomorrow you upgrade your jQuery version you will have to deal with all your bunch of deprecated/removed code and continue using your migration plugin. However you may use the migration plugin in case you absolutely need to use another plugin not yet upgraded, but this is temporary.

Categories : Jquery

How to use jquery properties in a jquery plugin EasyDate
Remove the single quotes: $(".easydate").easydate({format_future:false}); I have created a fiddle for this don't know whether this what you are expecting JSfiddle

Categories : Javascript

ckeditor and codemirror, conflicts with plugin with same name
Basically... rename one of the plugins. Change directory name and the name of registered plugin in the line: CKEDITOR.plugins.add( someNewName, { ... } ); Then check whether the plugin refers to itself somewhere inside of own body via editor.plugins. Correct it if necessary (most likely there's nothing like that). If there are some dialogs with redundant names, repeat the process by changing: CKEDITOR.dialog.add( someNewName, function( editor ) { ... } ); Finally, change your configuration file so it loads the renamed plugin. That's all. That was easy, wasn't it? ;)

Categories : Javascript

Eclipse Plugin Development: Make plugin dependent on CDT-plugin
Fro your first question, simply add the CDT plugins to your Required plug-ins of your project. Details here. Editors and natures are different things, you cannot set an "editor as a nature". Probably what you're searching for is the C++ nature you want to set for a project programmatically. Simply search the nature's ID in the .project file of a C++ project, then you can start looking into the details.

Categories : Java

Jquery plugin not able to add a div
Your selector is wrong, in order to use id selector you need # + id, ex #test will select the element with id test $("#test").test(); Demo: Fiddle

Categories : Jquery

Jscroll pagination plugin
That plugin actually isn't very good. I'm looking at the plugin's code, and sure enough, it doesn't provide a way to detect when you're at the end of the content. If you go to the plugin page and scroll down, it appears to be working quite nicely. However, when you look at the file democontent.html (he's hidden the text, you have to view the source) where the data is being retrieved from, you'll see it's only 17 items. But, it keeps loading bogus data as you scroll down. Not only does the plugin not detect the end of the data, but it also doesn't provide a way of stopping at all. If you'll notice, Anderson told the plugin to stop after 100 items are loaded, but he did this only in his example instead of writing this feature into the plugin. So, that's why your content isn't stopping. Yo

Categories : Javascript

Removing a jquery plugin
You can use the clearTimeout() method to clear your setTimeout(). More info here and here.

Categories : Jquery

why use each when creating a jquery plugin
The only thing you do to this is calling jQuery's bind on it. This internally does that operation for all elements of the set this. You would need to iterate over all elements with each when doing something with them that is not automatically applied to all items of the set.

Categories : Jquery

easy way to run a jquery plugin
$.fn.myplugin = function(){ // your code goes here. } Source Quote from jQuery website - Let's say we want to create a plugin that makes text within a set of retrieved elements green. All we have to do is add a function called greenify to $.fn and it will be available just like any other jQuery object method. $.fn.greenify = function() { this.css( "color", "green" ); }; $( "a" ).greenify(); // Makes all the links green. If you want to enable chaining, $(".myClass").greenify().css('color','white') like jquery calls can usually be return a reference to the original object. $.fn.greenify = function() { this.css( "color", "green" ); return this; } $( "a" ).greenify().addClass( "greenified" );

Categories : Jquery

Implementing a Jquery Plugin
You need to invoke the plugin on the element. You added the plugin, but that doesn't inherently cause it to target an element and execute its self; you must. $('.stickem-container').stickem(); Here's the Fullscreen jsFiddle (because of your margin-left:660px rule) Here's the relevant code

Categories : Jquery

jQuery plugin - best way to return this.each()
Try this, it is your code modified to iterate through each selector, and allows for chaining. (function ( $, undefined ) { $.fn.sticky = function() { return this.each(function(){ var self = this, isStickyWidth = self.data('sticky'), isStickyActive = false, windowHeight, elOffset = self.offset().top, elHeight; $(document).on("scroll", function(){ if(isStickyActive && windowHeight > elHeight) { var scrollPos = $('body').scrollTop(); if(scrollPos > elOffset) { self.css({'position':'fixed','top':'0px'}); } else { self.css({'position':'relative'}); } } })

Categories : Jquery

jquery plugin applied more than once
It's all at the discretion of the plugin writer. There is no "real" way for jQuery to say "Hey, don't do that!" However, a good plugin writer will usually have an "initialization" method that may assign a class or data variable to the original element the plugin was called on. Something like: /* Example Plug-in Setup */ (function($) { if (!$.myExample) { $.extend({ myExample: function(elm, command, args) { return elm.each(function(index){ // here a check is made to see if this plugin has touched this element before if (!$(this).hasClass('my-example')) { $.myExample.init.apply($(this), arguments); } else { // do work to

Categories : Jquery

jquery plugin get and set message
This is a commonly used basic skeleton of a jQuery plugin : (function($) { var parameters = { myDefault: "default" }; var methods = { init : function(options) { return this.each(function() { parameters = $.extend(parameters, options); }); }, myMethod: function(){} }; $.fn.myPlugin = function(methodOrOptions) { if ( methods[methodOrOptions] ) { return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) { // Default to "init" return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does no

Categories : Javascript

Plugging in a jQuery plugin
Right, bare-bones page worked fine. After digging a while longer I found this buried at the base of the page: <script src="http://code.jquery.com/jquery.js"></script> It seems having multiple versions of jQuery loaded is not a good thing to do.

Categories : Javascript

JQuery plugin does not work
The this keyword will not work inside the function function (e) { this.KeyDown(e); } because it's overwritten by jQuery. The new this refers to the element. Try something like: init: function() { var self = this; this.el.on('keydown', function (e) { self.KeyDown(e); }); },

Categories : Jquery

JQuery Plugin Optomisations
So, I have this new fiddle which I have done the following to: Shortened the code Refactored the code Enabled Tri State Stars (hover, selected, unselected) Introduced another setting for selectedImage The only thing left now is: Privatise function scope Do image preloading Take a look at both pieces of code to understand the different optomisations done. Tri State Code: function setImageSrcProper() { for (var i = 1; i < settings.numberOfStars; i++) { var id = '#star' + i; var selected = $(id).attr('data-selected'); var hover = $(id).attr('data-hover'); if (selected == 'true') { $(id).attr('src', settings.selectedImage); } else {

Categories : Javascript

JQuery .animate() in plugin
You need to "localize" your breathing variable. Currently it is common for all the elements using your plugin. The easiest way that comes to my mind is using element's data: (function($) { $.fn.Breath = function() { var options = $.extend({ minOpacity: 0, maxOpacity: 1, BreathIn: 1000, BreathOut: 3000 }, arguments[0]); return this.each(function() { var obj = $(this); obj.data("breathing", true); function breath() { if (stop()) return; obj.stop().animate({ opacity: options.minOpacity }, options.BreathOut, function() { if (stop()) return; obj.stop().animate({

Categories : Jquery

jQuery TableSort Plugin
It looks like the pager plugin for Tablesorter is swapping the <td> elements every time you switch pages for each row/column. I am guessing that your display:none style is only applied to the currently displayed <td> that you want to hide, so whenever you flip to the next page, the new <td> are flipped in, and are not affected by your display:none function. Assuming that your function loops through your <table> and finds the right column of <td> to hide depending on which checkbox is checked, you should be able to fix your issue by calling your function that hides the appropriate columns on click every time you click the pager next and previous buttons. EDIT: You can add the Next and Prev button selectors to your function as follows: //Add .next and .prev

Categories : Jquery

Jquery form plugin
your using ajax, so your 301 location header will have no effect to the overall browser window. you will have to return a structured data to your javascript and have javascript redirect instead. $(document).ready(function(){ $("#loginform").ajaxForm({ success: function (data) { if (data == "login failed") { $("#responselogin").html("Login Failed"); } else { window.location.href = "panel.php"; } } ).submit(); }); its actually better if you use json response for this. Since it's formatted better for browser consumption. for handling this using json you can do the following. first change your php code to return a json response $success = 0; if($username=="tarhe" && $password=="oweh") { $success = 1; } echo json_encode(array('success' => $success));

Categories : PHP

Add callback to jQuery plugin
You could use the jQuery promise method. It could look something like this $(document).ready(function() { $(".kkcount-down").kkcountdown({ dayText : 'DAY ', daysText : 'DAYS<br>', hoursText : ' ', minutesText : ' ', secondsText : 'HOURS', displayZeroDays : false, oneDayClass : 'one-day' }); $( ".kkcount-down" ).promise().done(function(){ $('#countdown').fadeTo(500, 1); }); }); / ** SEEING AS THIS DIDN'T WORK FOR YOU **/ Adding a delay to the fadeTo can give you the effect you want allowing for the kkcountdown to initiate. A 1 second delay in my opinion doesn't result in much to the end user but it will give you your cleaner look. So jQuery would be $(document).ready(function(){ // custom mod on line 92 by Ro

Categories : Javascript

(JQuery) how to set a event in plugin
Try $.fn.Lister = function(options){ var container = this; if(jQuery.isFunction(options.onButtonClicked)){ container.on('click', 'button', options.onButtonClicked) } // Get some data $.get('xxxx', function(result){ // foreach result, fill in container. each result item fills as a button. $(result).each(function(){ $(container).append('<button>'+ this.Name +'</button>'); }); }); } Then $(document).ready(function() { $('#container').Lister({ 'onButtonClicked' : function(e) { alert($(this).text()); } }); });

Categories : Jquery

Jquery border plugin
// corners v2 $.fn.corners2 = function (opts) { // defaults settings for corners2 var defaults = { // corners default style corners: 'default', // corners default radius border_radius: '1', // borders default style border_style: 'solid', // borders default color border_color: '#f7145a' // border size border_width: 1 }; // options var options = $.extend({}, defaults, opts); return this.each(function () { var element = $(this); $(this).css({ borderWidth:options.border_width, borderStyle:options.border_style, borderColor:options.border_color}); // corners switch (options.corners) { // all ca

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.