jquery-plugins

Extending jquery ui widget - how to access parent event

我是研究僧i 提交于 2020-01-01 05:26:05
问题 I'm trying to create a jQuery widget which extends from ui.slider. I'd like to have a custom method which executes on the 'slide' event. I tried overriding the parent's option just like when using the slider widget normally, but I ran into this problem with variable scopes: $.widget( "ui.myslider", $.ui.slider, { _create: function() { this.foo = "bar"; // Outputs "bar" this._mySlide(); // Outputs "undefined" when triggered this.options.slide = this._mySlide; $.ui.slider.prototype._create

best jquery-based lightbox / popup dialogbox?

笑着哭i 提交于 2020-01-01 03:41:12
问题 i'm looking for a jquery-based popup dialog box that we will use for : displaying static content pages (terms of use, etc) the contact us page (already uses the jquery form plugin for ajax submit) displaying full-size for photo thumbnails. can anybody recommend one that can fulfills all the above and that is rather lightweight and easy to use ? thanks in advance. 回答1: I use Fancybox - http://fancybox.net/ Handles pretty much any kind of content, rather easy to use and configure, and should

Simple jQuery file upload plugin (using only iframes)

走远了吗. 提交于 2020-01-01 03:35:07
问题 I had spent many hours searching the web to find a very simple and basic jQuery plugin to allow me to upload files without refreshing the page, I didn't want these big plugins with all their fancy techniques, and I wanted it to be easily added to my website. So I have just made my own little jQuery plugin to do so, and I have decided to share it with all of you in case anyone else is looking for one. Now I am not an expert with creating jQuery plugins, so if there are any improvements I could

jQuery validation plugin: how can I treat errors as warnings and allow form submit?

為{幸葍}努か 提交于 2020-01-01 02:40:15
问题 as the subject suggests, I am using the bassistance.de validation plugin (http://docs.jquery.com/Plugins/Validation/) and I would like to be able to submit the form even when there are validation errors. Basically, we only want to use the plug-in to warn the user of potential issues (please don't question the usability issues with this , I know). So, is there a way to do it easily or should I hack into the plugin code? Thanks in advance! 回答1: I will not question the usability issues around

jQuery plugins vs widgets

本秂侑毒 提交于 2020-01-01 01:12:46
问题 Few months ago I started some experiments with jQuery plugin. I found some tutorials on the Interenet and I started to put something together. A couple of days ago I had the need to build my own "plugin" and got back to my old project. Trying to find some more informations on the internet, I bumped in these new "things" called widgets. For what I understand I should forget about plugins and start developing widgets. Are the plugins an old concept or are still valid? What is the best approach

I need a JQuery IP Mask plugin

岁酱吖の 提交于 2019-12-31 12:59:36
问题 Is there a good IP Mask plugin for JQuery? I've tried Masked Input Plugin but it doesn't IP Addresses with less than 12 digits. Then I've tried meioMask and this doesn't work with less than 12 digits either. Any suggestions? 回答1: You can find your answer in this post : http://mlntn.com/2009/12/30/jquery-ip-address-plugin/ and a demo for you to try http://mlntn.com/demos/jquery-ipaddress/ 回答2: This is an older post however for someone who wants an easy way to manipulate multiple inputs,

Call Jquery function

前提是你 提交于 2019-12-31 12:51:13
问题 I have a Jquery function like the following function myFunction(){ $.messager.show({ title:'My Title', msg:'The message content', showType:'fade', style:{ right:'', bottom:'' } }); } If certain condition is true, I would like to invoke myFunction and a popup message will display. How can I call myFunction? so that it will be something like onClick(). 回答1: To call the function on click of some html element (control). $('#controlID').click(myFunction); You will need to ensure you bind the event

BxSlider displayes last slide as first slide

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-31 10:42:18
问题 I have created 4 sliders. Initially all 4 are hidden (display:none) so I have used this code to display the relevant slider on click of its respective category. The slider configuration. touchEnabled: true, hideControlOnEnd: true, preloadImages: 'all', infiniteLoop: false, mode: 'horizontal', startSlide: 0, slideWidth: 300, minSlides: 2, maxSlides: 3, slideMargin: 10, pager: false, slideSelector: ".isotope-item", nextSelector: "#forefoo2_next", prevSelector: "#forefoo2_prev", nextText: '',

jQuery how to stop Vimeo video when click

懵懂的女人 提交于 2019-12-31 10:02:22
问题 here is the simple code: http://jsfiddle.net/YAFuW/1/ basicly i tried to use like this: <iframe src="http://player.vimeo.com/video/40977539?api=1" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <a href="#">STOP</a> $('a').click(function() { alert('stoped'); froogaloop.api('unload'); }); 回答1: I don't know a "good" or "right" way to accomplish this cross-browser. Youtube's JavaScript API fails, too. But this method is reliable and

Rails 3.1 + Paperclip + jQuery fileupload

ⅰ亾dé卋堺 提交于 2019-12-31 08:39:11
问题 I've been looking for a way to set up Ruby on Rails 3.1 with Paperclip and jQuery fileupload. Looking at a tutorial at jQuery fileupload page I got the system set up but I can't find a way to make paperclip process the uploaded file. Here's what I have (in short): # model has_attached_file :photo ... # view = form_for @user, :html => {:multipart => true} do |f| f.file_field :photo, :multiple => true f.submit # controller def create @user = User.new params[:user] if @user.save render :json =>