Month: November 2015

imagesLoaded-检测图片是否正确加载的js插件

简要教程 imagesLoaded是一款用于检测页面中的图片是否被加载的js插件。imagesLoaded是非常有用的插件,当你的页面中某幅图片没有被加载时,默认会显示一个红叉或图片alt文本,imagesLoaded可以将未加载的图片替换为你设置的图片。 安装 你可以通过Bower或npm来安装giantess分类过滤和排序插件。 bower install imagesloaded npm install imagesloaded 或者直接使用下载包中的imagesloaded.pkgd.js文件及压缩版的imagesloaded.pkgd.min.js。在页面中将它引入即可。 <script src="/… Read More

sed 执行错误:sed: 1: “…”: Invalid command code f

运行 grep -l \'texttofind\' * | xargs sed -i 's/toreplace/replacewith/g' Im getting this error when I run the above command in the terminal. sed: 1: "forkliftDailyChecklistW ...": invalid command code f 解决: I figured out what was wrong. I needed to add '' after the -i and before the 's/../../': grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewi…

bootstrap 3 多选框 awesome bootstrap checkbox

Awesome Bootstrap Checkbox Font Awesome Bootstrap Checkboxes & Radios plugin. Pure CSS way to make inputs look prettier. No Javascript! Demo Use First just include awesome-bootstrap-checkbox.css somewhere in your HTML, or add the equivalent files to your Sass / Less configuration. Next, everything is based on code convention. Here is checkbox ma… Read More

Magento 创建用户代码 Creating a new customer in Magento(RESTful,PHP)

$customer = Mage::getModel('customer/customer'); //$customer = new Mage_Customer_Model_Customer(); $password = 'iks123456'; $email = 'gotodiscuss@ikeepstudying.com'; $customer->setWebsiteId(Mage::app()->getWebsite()->getId()); $customer->loadByEmail($email); //Zend_Debug::dump($customer->debug()); ex… Read More

magento 1.9 用户无法登录 magento 1.9 customer can not login

Looks like an issue with form-key Go to app/design/frontend/[Your-package]/[Your-theme]/template/customer/form/login.phtml and template/persistent/customer/form/login.phtml and under Find: <ul class=”form-list”> And paste this right after the code above the following: <input name="form_key" type="hidden" value="<?ph… Read More

禁止点击背景而关闭bootstrap弹出框 Disable click outside of bootstrap model area to close modal

On Options chapter, in the page you linked, you can see the backdrop option. Passing this option with value 'static' will prevent closing the modal. As @PedroVagner pointed on comments, you also can pass {keyboard: false} to prevent closing the modal by pressing Esc. If you opening the modal by js use: $('#myModal').modal({backdrop: 'static', keyboard:… Read

调整谷歌reCAPTCHA大小 How to resize the Google noCAPTCHA reCAPTCHA

最近调试reCAPTCHA的时候,发现手机版的reCAPTCHA会不适应大小: 经修改后应该为: 代码如下: .g-recaptcha {transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;} 或者: @media screen and (max-height: 575px){ .g-recaptcha {transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-tran… Read More

Magento 获取已登录用户的信息– Get Logged In Customer’s Full Name, First Name, Last Name and Email Address

// Check if any customer is logged in or not if (Mage::getSingleton('customer/session')->isLoggedIn()) { // Load the customer's data $customer = Mage::getSingleton('customer/session')->getCustomer(); $customer->getPrefix(); $customer->getName(); // Full Name $customer->getFirstname(); // First Name $customer->g… Read More

Magento 主题结构 The structure of a Magento theme

The structure of a Magento theme The files in a Magento theme are divided into two main directories: app and skin, as shown in the following screenshot: The following is the description of the two directories: app: The app/design/frontend/base/default/ directory contains the layout, translation, and template files skin: The skin/frontend/base/defa… Read More