Wednesday, May 22, 2013

Using jQuery


Using jQuery


Cities And Skylines Wallpapers [Wallpaper Wednesday]
Photography lovers would not miss out on taking photos of city skylines, and while most of us would love to put our own creations on our desktops, a city skyline view is not really that easy to capture. It’s a good thing that there are a lot of skyline wallpapers out there that you can use in place. We’ve done the hard part for you and grouped these wallpapers together in a compilation below.

while Using jQuery you can also use other queries
In this week’s Wallpaper Wednesday, we are featuring more than 30 beautiful cities and skylines wallpapers. From Manhattan to Tokyo, Prague to Taipei, these beautiful celebrations of the architecture of the world will surely be a sight for sore eyes.
Read Also: 45 Awe-Inspiring Landmarks Around The World
Arc De Triomphe Paris France. Available in various sizes.
As Far As You Can See. Available in 1920×1080.
Buildings Foggy Sky. Available in the following size(s): 1366×768, 1920×1080, 2560×1440.
Chicago. Available in 2560×1600.
Chicago Skyline. Available in 5629×3518.
City Night Skyline. Available in 1920×1200.
City Overview. Available in the following size(s): 1440×900, 1900×900, 1920×1080, 2500×1400, 2500×1600.
City Wallpaper. Available in 1920×1080.
Colourful City. Available in 1600×1200, 1920×1080, 2560×1600.
Down On Nyc. Available in 1920×2111.
Dubai Skyscrapers. Available in various sizes.
Empire. Available in 2560×1600.
First World. Available in the following size(s): 1024×768, 1280×1024, 1680×1050, 1600×1200, 1920×1080, 1920×1200.
Future Manhattan. Available in 3226×2016.
London Panoramic. Available in the following size(s): 1280×800, 1920×1200, 4835×3021.
Manhattan New York. Available in 1920×967.
Natgeo Tokyo. Available in 1600×1000.
New York City Black And White. Available in various sizes.
New York Skyline. Available in 1680×1050.
New York State Of Mind. Available in 1680×1050.
Night City Lights. Available in 2560×1440.
Piazza San Pietro. Available in various sizes.
Prague In Tilt Shift III. Available in the following size(s): 1920×1080, 1920×1200, 2560×1600.
Sacre Coeur. Available in the following size(s): 1280×720, 1280×800, 1366×768, 1600×1000, 1920×1080, 1920×1200, 2560×1440, 2560×1600.
Skyscraper. Available in the following size(s): 1280×800, 1400×900, 1920×1200.
Taipei Tilt-Shift. Available in the following size(s): 640×960, 1280×850.
Strange Intruder. Available in 1920×1200.
Tilt Shift Wallpaper 15. Available in 1920×1080.
Tilt-Shift Wallpaper. Available in the following size(s): 640×960, 1280×850.
Top Of The Rock. Available in the following size(s): 640×1136, 2048×2048, 2880×1800.
Top Of The World. Available in 1600×900.
Vertical. Available in 2560×1600.
XYork. Available in 1680×1050.
Related posts:
1. Apple Art Wallpapers [Wallpaper Wednesday]
2. Sci-Fi Wallpapers [Wallpaper Wednesday]
3. Nature Wallpapers [Wallpaper Wednesday]
4. Vintage & Retro Wallpapers [Wallpaper Wednesday]







jQuery How-to: Creating and Inserting New Element (Part 2)
In our previous post, we started a discussion on how to create and insert new elements with the jQuery (and JavaScript) Append method. We’ve learned how to create and insert new elements to the body document.
In its basic form, the Append method inserts the new element as the last child or (technically) before the closing tag of a specified element. In certain cases, however, we might need to insert the new element at a more specific point. In this post, we will tackle this issue.
Recommended Reading: jQuery: Creating And Inserting New Element – Part I
For demonstration purposes, we have prepared the following HTML unordered list structure, containing the id, list.
<ul id="list"> <li>Ut enim ad minim veniam.</li> <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</li> <li>Duis aute irure dolor in reprehenderit.</li> <li>Sunt in culpa qui officia deserunt mollit.</li> <li>Excepteur sint occaecat cupidatat non proident.</li> </ul>
Insert New Element as the First Child
In this first example, we will create a new element and insert it as the first child of a specified element (parent). As in our previous post, we will first look at how it is done purely with JavaScript and subsequently with jQuery.
The idea in the following example is we will create a new <li> and then insert it as the first child of the <ul>. So, let’s create a new element as well as the text inside it, like so.
var li = document.createElement('li'), txt = document.createTextNode('This is the text in new element.'); li.appendChild(txt);
To insert this element as the first child, we can use the JavaScript .insertBefore() function. This function allows us to insert an element before an existing element.
Now, we need to specify which parent to nest the new element inside. In this example, we specify the element by getting its ID attribute, like so:
ul = document.getElementById('list');
Then, we need to define which element to place the "new element" before. In our case, it would be the first child of the parent. In JavaScript, we can get the first child element with .firstChild function and we store it in a variable called firstChild.
var firstChild = ul.firstChild;
We then apply the function. First, we set the parent element with ul variable followed by .insertBefore() function, like so.
ul.insertBefore();
Inside the parentheses, we specify the new element followed by the reference element (the first child of the parent).
ul.insertBefore(li, firstChild);
This code above will insert the new li before the first child element. If we take a look at the browsers and inspect the element through the Developer Tool, we will get this result:
We see that our new element is now the first child of the <ul>.
Using jQuery
Alternatively, we can use jQuery. jQuery has a function called .prepend(). We can achieve the same result by writing it in this one way.
$('#list').prepend('<li>This is the text in new element. (with jQuery)</li>');
Insert New Element in Specific Point
Now, how about adding the new element at a more specific point, such as before or after the 3rd child – as opposed to first and last. Here’s how we do it in both JavaScript and jQuery.
We have created a new element from the previous example, like so:
var li = document.createElement('li'), txt = document.createTextNode('This is the text in new element.'); li.appendChild(txt);
We need to grab the list element. In JavaScript, we use .getElementsByTagName() to select element by their tag name.
var list = document.getElementsByTagName('li');
After that, we need to get the 3rd list element, which can be specified with its index number. The index number in JavaScript started from 0, thus the 3rd element would be 2 in the index. In the following code, we store this element in nthList variable.
var nthList = list[2];
Now, we can use .insertBefore() function to add the new element before the 3rd child of specified element:
ul.insertBefore(li, nthList);
If we view the browser, we will get:
To insert the new element after it, we can use .insertBefore() function along with .nextSibling(), which specifies the next element.
ul.insertBefore(li, nthList.nextSibling);
Contrary to the previous example, the following code will insert the new element after the 3rd child of the specified element.
Using jQuery
jQuery introduced .before() and .after() function to simplify the process. And, we can use jQuery .eq() function to target element upon their index.
Referring to our example above, we can do the same thing with:
$('li').eq(2).before('<li'>This is the text in new element. (with jQuery)</li>');
to add the new element before the 3rd child of specified element. Or, we can write it this way to insert after it.
$('li').eq(2).after('<li'>This is the text in new element. (with jQuery)</li>');
Conclusion
We have learned how to create and insert new elements with JavaScript and used jQuery functions to simplify the process (yet achieve the same result). It is now up to your choice to figure out which is more efficient to your case.
Hopefully, this session can be useful for you, paticularly for those who are just getting started with jQuery or JavaScript. If you have anything to ask, feel free to add it in the comment section below.
Useful Resources
Below are a few useful resources to dig into this subject further.
• JavaScript .insertBefore Function – MDN
• JavaScript .nextSibling function – MDN
• jQuery .before() Function – jQuery API Documentation
• jQuery .after() Function – jQuery API Documentation
• jQuery .eq() Function – jQuery API Documentation
Related posts:
1. Creating a Volume Controller with jQuery UI Slider
2. Web Design: Drag and Drop with jQuery UI Sortable
3. Understanding Pseudo-Element :before and :after
4. How to: Customizing and Theming jQuery UI Datepicker







Read More »

60 Shopping Cart UI For Your Inspiration
Statistics says that online shopping is growing day by day. But what is the secret component of each popular online store? Is it the variety of goods or its quantity? I think these days they are not key elements anymore. In fact, we should be looking at design attractiveness and usability to keep buyers on the site.
In order to create really cool aesthetic design, all website elements should be taken under consideration, and when it comes to a site banked on e-commerce, we mustn’t forget about the shopping cart.
Today I’d like to showcase 40 shopping cart designs that shows how you can enable and engage online shopping. Hopefully the list will inspire you to create your own one or pick out a PSD to download for free in the second half of the list.
Recommended Reading: Open Source E-Commerce Shopping Carts – Best Of
1. Sweet House Recently Added Products by Stanislav Kirilov
2. Your shopping cart has been updated by Veerle Pieters
3. Desina Online Store
4. SpiceBlue Shopping Cart website design by Sunil Joshi
5. Menu for a French clothes shop by Antony Legrand
6. Food ordering web application by Tamerlan Soziev
7. Shopping cart by Daniel Sigvardsson
8. Shopping cart by Mynus
9. Add to Cart by Blue Acorn
10. Hulala Header by Paresh Khatri
11. Awesome Cart by Paresh Khatri
12. Online Shopping by Irshadh Ahamed
13. Shopping Cart by Jonno Riekwel
14. Search bar with shopping cart by Zoltan Mitlik
15. Cart Blueprint by Igor Garybaldi
16. Header elements for Yosto by Maksim Harmaza
17. Shopping Cart by Adi Pintilie
18. La Ganache e-commerce website by Cédric Converset
19. Checkout progress bar – Web UI by Jason Wu
20. Purple cart by Fuzzco
21. Shopping Cart by Vinny Singh
22. Tailored Cart by Matt Johnston
23. Shopping cart by Dennis Covent
24. Add To Cart Button by Blue Acorn
25. Cart & Search by Bryan Le
26. Shoppingcart by Sofie De Grande
27. Acris Shop by Prakash Ghodke
28. E-commerce by Mario Azzi
29. MUD MAP v2 – Add To Cart by Callum Chapman
30. Checkout Process by Rui Macedo
31. Give a Shirt Checkout Dropdown by Vin Thomas
32. Shopping cart by Mladen Zivanovic
33. Mouse to Minx Online Shop
34. Checkout Button by Ionut Zamfir
35. Checkout by Kevin John Gomez
36. Kickadss Checkout by Robin Kylander
37. Added To Cart by Gustavs Cirulis
38. Shopping Cart Widget by Alister Coyne
39. Product Display 3.1 by Matthew Morek
40. Boob Baby Online Store
Bonus: Free Shopping Cart PDS’s to Download
Of course, you can create a shopping cart design from scratch to give it the perfect fit to your design. But if you do not want to “reinvent the wheel”, you can use ready-made cart designs that can be downloaded for free. Here are 20 more free shopping cart designs in PSD format.
41. Free Quick Cart by Orman Clark
42. Free Shopping Cart by Asif Alleem
43. Free Shopping bag by Lukáš Majzlan
44. Free Shopping Cart Dropdown by Emrah Demirag
45. Shopping cart popup interface (PSD) by softerea
46. Free Cart Dropdown by kamal
47. Free Add To Cart Buttons by Bharat Sharma
48. Free Product Box by Zulal Ahmad
49. Free Shopping Cart Widget
50. Your Free Cart Widget by Pawel Kadysz
51. Free Shopping Cart Elements PSD by Ali Asghar
52. Free shopping widget PSD by Ali Asghar
53. My Shopping Cart by Adrian Alexandru
54. Free Shopping Cart Interface by Paul Mackenzie
55. Add to Cart Buttons by Orman Clark
56. Free Cart Modal Popup by Dan Edwards
57. Shopping cart by Kasper Mikiewicz
58. Free Blue Button by Maria Shanina
59. Mini Shopping Cart by Miroslav Bekyarov
60. Free Shopping Cart PSD by Jay Hafling
Related posts:
1. 30 Professional Looking e-Commerce Sites For Your Inspiration
2. 7 Free E-Commerce WordPress Plugins
3. 20 Mobile Apps For Shopping Discounts And Deals
4. 5 Tips To Creating A More Usable E-Commerce Site