Viewing 1 to 10 of 41 items
Archive | Front-end RSS feed for this section

Make a link to cover an entire div

If you want a link to cover an entire div, an idea would be to create an empty <a> tag as the first child: <div class=”covered-div”> <a class=”cover-link” href=”/my-link”></a> <!– other content as usual –> </div> div.covered-div { position: relative; } a.cover-link { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } This  Full Article…

0

jQuery – Show and hide Div on scroll

If you have a div that sits at the bottom of a slideshow that you want to disappear when the user scrolls down, and then reappears when scrolls back to the top, you can follow the below example. <div> <div class=”a”> A </div> </div>​ $(window).scroll(function() { if ($(this).scrollTop() > 0) { $(‘.a’).fadeOut(); } else {  Full Article…

0

How to create X close button by using CSS

As a pure CSS solution for the close or ‘times’ symbol, you can use the ISO code with the content property. I often use this for :after or :before pseudo selectors. The content code is \00d7. Example div:after{ display: inline-block; content: “\00d7”; /* This will render the ‘X’ */ } You can then style and position  Full Article…

0

jQuery – How check or uncheck all checkbox

In this tutorial, we are going to see how to check or uncheck a group of checkboxes using jQuery. We can use this feature in various scenarios like selecting multiple records to perform database updates or delete. In this tutorial, we have a simple example with less code for obtaining this feature using jQuery. Form  Full Article…

0

Jquery – Get month text from date

You can use jQuery to generate the texts from date, month, or year. Here is an example: let date = new Date(2021, 06, 21); // 2021-06-21 let longMonth = date.toLocaleString(‘en-us’, { month: ‘long’ }); /* June */ let shortMonth = date.toLocaleString(‘en-us’, { month: ‘short’ }); /* Jun */ let narrowMonth = date.toLocaleString(‘en-us’, { month: ‘narrow’  Full Article…

0

Magento – Product Collection

In this blog, we will see some important function in magento product collection class. Product Collection class in magento is Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection. Lets look at the important functions Get All Products of a category 1 2 3 $collection = Mage::getResourceModel('catalog/product_collection')             ->setStoreId($this->getStoreId())             ->addCategoryFilter($category); Tn this the addCategoryFilter() function, is used to get all products of a particular  Full Article…

0

Magento – Functions cheatsheet

General functions Function Description $this->getRequest()->getServer(‘HTTP_REFERER’); Get the referer URL Product related functions Function Description $product->getName() Get product name $product->getSku() Get product sku Mage::getModel(‘cataloginventory/stock_item’)->loadByProduct($_product)->getQty() Get product stock $product->getResource()->getAttribute(‘color’)->getFrontend()->getValue($product) Get a product attribute value (like color/size) $product->isSaleable() checks if a product is salable $product->isisAvailable() checks if a product type is salable Mage::getModel(‘catalogrule/rule’)->calcProductPriceRule($product,$product->getPrice()) Gets the product final price  Full Article…

0