jQuery Mobile and AngularJS Working Together

http://simonguest.com/2013/04/08/jquery-mobile-and-angularjs-working-together/ http://0not.net/index.php/using-angularjs-and-jquery-mobile/ At the bottom of body, load AngularJS and then jQM Use jQM for routing (which is the default, as long as you don’t include ngRoute)

2014-09-21 · 1 min · 27 words · Me

推送 訊息

http://pusher.com/ Connections:20 MAX ,Channels:UNLIMITED , Messages / day:100,000

2014-09-13 · 1 min · 8 words · Me

[轉]jQuery file upload maxNumberOfFiles options--無用

http://stackoverflow.com/questions/16723877/jquery-file-upload-maxnumberoffiles-and-getnumberoffiles-options I believe getNumberOfFiles was only added as an option to a recent version of jquery.fileupload-ui.js (8.2.1). As an alternative, you can set the option singleFileUploads to false, and in the add callback you can throw errors if more than one file is added. var maxFiles = 1; $('#fileupload').fileupload({ singleFileUploads: false, url: '/uploadUrl' }).bind('fileuploadadd', function (e, data) { var fileCount = data.files.length; if (fileCount > maxFiles) { alert("The max number of files is "+maxFiles); return false; } });

2014-08-18 · 1 min · 78 words · Me

[轉]jquery file upload 改檔名

https://github.com/blueimp/jQuery-File-Upload/issues/622 看連結最下面 Here is some updated code that works with the most recent version as of July 18, 2014. class CustomUploadHandler extends UploadHandler { /* Converts a filename into a randomized file name */ private function _generateRandomFileName($name) { $ext = pathinfo($name, PATHINFO_EXTENSION); return md5(uniqid(rand(), true)).'.'.$ext; } /* Overrides original functionality */ protected function trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range) { $name = parent::trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range); return $this->_generateRandomFileName($name); } } $upload_handler = new CustomUploadHandler();

2014-08-16 · 1 min · 78 words · Me

[轉]圖片超過設定寬高,自動比較縮放 css方法 高手

http://stackoverflow.com/questions/11757537/css-image-size-how-to-fill-not-stretch .container { width: 150px; height: 100px; background-image: url(“http://i.stack.imgur.com/2OrtT.jpg"); background-size: cover; background-repeat: no-repeat; background-position: 50% 50%; }​ http://stackoverflow.com/questions/9883289/set-background-image-css-to-the-featured-image-in-wordpress-using-jquery 這個做了我想做的事,也是高手 $(‘section img’).each( function(){ var src = this.src, h = $(this).height(), w = $(this).width(); $(this).closest(‘div’).css({ ‘min-width’ : w, ‘min-height’ : h, ‘background-image’ : ‘url(’ + src + ‘)’, ‘background-repeat’ : ’no-repeat’, ‘background-position’ : ‘50% 50%’ }); }).remove(); ======= ‘background-image’ : ‘url(’ + src + ‘)’, 記得在加上”" => ‘background-image’ : ‘url("’ + src + ‘")’, ...

2014-08-14 · 1 min · 72 words · Me