Skip to content

Instantly share code, notes, and snippets.

@lk-snippets
lk-snippets / google_product_tax_info.xml
Created April 2, 2012 19:52
Google Product Listing Tax Info Format
<g:tax>
<g:country>US</g:country> //The country an item is taxed in (as an ISO 3166 country code)
<g:region>CA</g:region> //The geographic region that a tax rate applies to, e.g., in the US, the two-letter state abbreviation, ZIP code, or ZIP code range using * wildcard
<g:rate>8.25</g:rate> //The tax rate as a percent of the item price, i.e., number, as a percentage
<g:tax_ship>y</g:tax_ship> //Boolean value for whether you charge tax on shipping, y for yes or n for no - the default value is n
</g:tax>
@lk-snippets
lk-snippets / image_switcher.html
Created April 2, 2012 19:14
Changing an image on hover
<!-- First include the jQuery library. You can just include Google's hosted version of jQuery by including the below script. -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<!-- Then comes our code. -->
<script type="text/javascript">
$(function(){ //Don't worry about this part
$('#image-to-switch').hover( //Finds the HTML element in the same way as CSS... this grabs the image with the id of "image-to-switch", then we call the magic hover function
function(){ //The hover function contains two other functions. The first defines what you want to do when the mouse enters the object
$(this).attr('src', 'some-new-image.jpg'); //$(this) refers to the element you selected previously (#image-to-switch). Then we ask to change the attribute (attr) named 'source' (src) to some new value (some-new-image.jpg)