.each()
Consider the following markup:<div id="dv">
<input type="text" value="text box" />
<p>paragraph element</p>
<span>span element</span>
</div>
Suppose we want to find out the tag name of each element present inside this div. In this case we will use .each iterator
$('#dv').children().each(function(index, element) {
console.log('element at index ' + index + 'is ' + (this.tagName).toLowerCase();
});
Output:
element at index 0 is input
element at index 1 is p
element at index 2 is span
each() function takes 2 parameters, index of current element and the DOM element itself. Therefore, this will refer to the DOM element inside each(). We can get the tag name using tagName property of DOM element.(This post explains it in detail). To use the corresponding jQuery object, use $(this)
$.each()
$.each takes 2 parameters. First is the object over which the iteration is to be done and second is the callback function that will execute on each iteration. The callback function provides 2 parameter, first is index of current element(or you can say key in case of objects) in object and second the value at that index.First, let us iterate over a js array.
var myArray = [10,20,30,40,50];
$.each(myArray, function(index, value) {
console.log('element at index ' + index + ' is ' + value);
});
Output:
element at index 0 is 10
element at index 1 is 20
element at index 2 is 30
element at index 3 is 40
element at index 4 is 50
Another example using an object:
var myObj = {
"Google" : "http://google.com",
"Reddit" : "http://reddit.com",
"Mashable" : "http://mashable.com"
};
$.each(myObj, function(key, value) {
console.log('value for key ' + key + ' is ' + value);
});
Output:
value for key Google is http://google.com
value for key Reddit is http://reddit.com
value for key Mashable is http://mashable.com
That’s it. If you still have doubts, let me know in comments.
- “We have late game.”
- “Just play passive.”
- “WTF are you building?”
- “Play efficiently.”
- “It depends.”
- “They know how to trade.”
2 + 2 = 4. REALLY.
- Get from a point of safety to a point where you can attack.
- Do your damage.
- Somehow avoid their damage.
- Get out to safety.
POSITIONING KILLS CHAMPIONS
- Short: This is in range for a melee auto attack, and closer.
- Medium: This is the range for a ranged auto attack, and closer until you get to Short.
- Long: This is the range for a far skillshot, and closer until you get to Medium.
- Safe: This is out of range of every ability, except extremely long range abilities like Xerath, Lux, and Caitlyn’s ult.
- Hey, I’m already here!
- Auto, W with rage, Q, maybe one more auto.
- He’s stunned, W is OP!
- E dash out.
- E Dash in
- Auto, W with rage, Q, maybe one more auto
- He’s stunned, W is OP!
- E Dash out
- I can E dash twice, but that leaves me without step 4, so screw it, I’ll walk up.
- If I can get to Medium, I can dash in and do my thing.
- I <3 Stuns.
- I can just run. I can use the E I saved to dodge a skillshot or get to a bush.
- Not happening.
- Still don’t care.
- I can dash whatever he throws at me.
- Still don’t care.
- I love farm lanes! Why get closer?
- Farmville is fun…
- Do I want to ult? Nah.
- I wonder if Zynga’s gonna give me a discount?
- I hope he doesn’t get any closer, I can hit him from here.
- TASTE THE RAINBOW! Q Q Q Q Q.
- Please don’t hit me with skillshots.
- I still hope he doesn’t get close to me.
- I could hit him at long! Why is he so close?
- DAMMIT! My Qs stop me to cast them! And E costs too much mana!
- OH SHIT HE DASHED THROUGH MY WALL!
- FLASH! FLASH! FLASH!
- SOMEONE MAKE THE BAD MAN STOP!
- THIS IS NO FAIR MY Q TAKES TOO LONG TO FIRE HE JUST DODGES
- OH SHIT I BURNED FLASH ALREADY
- Fucking jungler, doesn’t gank. Reported.
HEARTHSTONE’S FOR NOOBS.
WWE WITH AUTHORITY’S WHERE IT’S AT!
- I can E myself to proc my passive, and get the run speed to cross from her auto attack range into mine.
- I can auto and W, as long as she autos me before I W.
- The W heal will cover one auto. It will cover nothing if I use it early. I’ll have to dodge her E+Q manually though.
- She should still be slowed from the E, and my W proccing my passive should give me the speed to get out.
BESIDES, IT JUST COMES DOWN TO WHO DRAWS RAGNAROS FIRST ANYWAY
YOU WANT LOGISTICS? JOIN THE ARMY. MARINES MAKE DO.
- He walks into Gnar’s space himself to take a CS.
- He doesn’t get close enough to actually attack Gnar.
- Gnar hits everything, including his slow
- He can’t get away, slowed, as Gnar attack kites forward, and is nowhere near a bush or tower.
SUMMONER’S RIFT, THE HOCKEY RINK
HOW TO BEAT MICHAEL JORDAN, STEP ONE: DON”T PLAY HIM IN BASKETBALL
Pop-ups, by definition, ruin the user experience. That’s it. If a pop-up gets opt-ins for an inconsequential newsletter that Gmail filters out anyway, fine. But don’t claim pop-ups are good UX. Let’s examine the arguments I’ve run into for pop-ups-as-good UX.
1. “If you design it well, users won’t mind.”
Umm… yes they will. But there’s a bigger problem: you’re now confusing UX design – a narrower topic – with user experience. From a strict UX design perspective, I’ll grant that you could design an aesthetically acceptable pop-up. On usertesting.com, the example of a pop-up on booking.com is used. I think it looks crummy, you can judge for yourself, but from a broader user experience standpoint, we’re at an impasse. “A good example from Booking.com of how to retain abandoning visitors with a popup without being too intrusive or distracting your visitors too much.”“Too much” is a subjective judgement call you’re making on behalf of your users because you want the conversions. That’s not acceptable UX – unless your users have specifically told you during UX user research they enjoy pop-ups. Good luck with that.
This is the booking.com example of what the author calls a “tastefully designed” pop-up:

2. “As long as you don’t show them a pop-up upon entry, it’s ok.”
If I’m walking in a park, I’d rather step on dog poop at the end of my walk than the beginning. But all things being equal, I’d rather not step in poop at all.3. “If the pop-up shows relevant content, it’s not annoying.”
All pop-ups are, by their definition, annoying. If your content is so amazing, so deeply relevant, I will eventually find it and I will probably do business with you. Maybe not today, but tomorrow or the next. If you have something truly great or indispensable on your site, all my colleagues will be sharing it, and I’ll be back.Here’s the “relevant content” rationale: “If the content helps the visitor solve their problem, find the right solution, or get answers to their questions, the popup won’t be perceived as annoying.”
Perhaps. But I’ve never had a pop-up answer a specific question I had, so I can’t say. I’ve had plenty of web sites answer my questions, and if they do it exceptionally or consistently, I subscribe to them. What about this is broken that requires a pop-up guessing at my intent?
“Instead, it will be seen as helpful, or at least as intending to help, not disturb.” Not sure what UX planet you are living on, but helpful is not about being interrupted. It’s about being there when I need you. It’s about letting me easily escalate the relationship. Pop-ups are like copping a feel. They are completely out of context of the content date we are having. It will be seen for what it is: an aggressive attempt to secure my opt-in. If it works, then it works. I’ve bought products from aggressive salespeople before. But leave “good UX” out of it.
4. Personalize your pop-ups by visitor groups.
Two problems: personalized pop-ups are still pop-ups. I don’t care if you left the poop on my sidewalk specifically for me to step in. It’s still poop. Second: classifying visitors into interest groups is a difficult task until itself. My interests tend to be individual, so if you send me a group message, I know you’re guessing. Lumping me into an “interest group” isn’t so personal.This supposedly good example ad of “personalized pop-up” also includes an insult:

If you’re going to insult me when I opt-out, at least give me a “Yo mama!”. That would at least crack a smile.
5. Users don’t care because they don’t complain.
Consider this a formal complaint. Your pop-ups suck.More rationalizations: “Visitors don’t seem to really care about it at all. “We had absolutely zero user complaints” said the guys from WPBeginner.”
Well, first off, it takes some effort to complain properly in this world. An annoying pop-up is pretty far down on the complaints list, below an Internet outage, a cancelled plane flight, or a blue screen of death. Doesn’t mean it’s not irritating. Also, I have no business relationship with you. If you had a box on your site saying “do you hate our pop-ups,” I would have clicked “yes.”
6. We only show the same reader a pop-up once a month, so that makes it good UX.
I don’t want to see the pop-up once a year. And: you’re assuming I’m using the same browser with the same cookies on the same device. Nah, I’m gonna see that pop-up more than once a month.7. Bounce rate didn’t go up, so we’re all set.
A bounce rate is a small piece of the puzzle. It doesn’t account for brand perception. I can tell you this: I am less likely to socially share and refer pages and web sites that have pop-ups. Where’s the data on that behavior?More justification for user interruption: “Plus if I’m really smart I can actually use popups to enhance UX like Vero does. When you stay for longer than 30 seconds on their landing page and don’t take action a popup in the right corner of your browser window will appear asking “What is the main thing preventing you from signing up to Vero at this point?””
Thanks for letting me know, I’ll avoid Vero like the plague. That may be a useful data gathering and conversion tool. But that’s not a better user experience.
There is ONE thing I can think of that might improve my UX via pop-up. If the founder of your site – not a low-level service rep 5,000 miles away, but your founder – sent me a pop-up instant message asking me, “What do you think of our site? Did you find what you were looking for?” And then interacted with me thoughtfully. That might work. But that’s about one-to-one relationships – and the great user experience that stems from making such a connection.
The wrap – pop-ups may convert, but they don’t UX
Pop-ups may be effective from a very narrow view. If they weren’t, we wouldn’t see so many of them. But let’s view them for what they are. Dressing them up as “good UX” is a futile endeavor that obscures an honest assessment.
Embossing is simply raising the surface of your design so that it has some depth. It’s the real world equivalent to bevel effects and likely derives from relief sculptures—resembling most closely the bas-relief where the depth is perceived as a lot more than is actually there. The word itself is old French, coming from em (into) and boce (protuberance).
As for how it relates to graphic design—embossing has been used as a finish for high end printed products for hundreds of years. It’s a great way to give your design another dimension that print simply cannot do. Emboss can be used by itself or together with foil, coatings or printing.
How it’s Done
Embossing is done by pressing a sheet of paper (or other substrate) into a female die, that has a design engraved or etched into it. This is usually done with a male counterpart underneath the paper, so that the paper is sandwiched between the two and the design is transferred to the paper.Although embossing seems to be quite deep visually, it is commonly no more than 15 microns and at most, 25 microns. That’s 25 thousands of an inch. Your average emboss is about 1/64th of an inch. You can see in this photo how the depth of an emboss die affects the appearance of the final piece. Note that as the depth of the die increases, there’s a higher chance of the paper tearing (as can be seen in the “D” of “guide”).
While embossing technically refers to a raised surface, embossing can also be done to create a depressed design in a surface. In the graphic design and printing industry, this is usually referred to as “deboss.” For a deboss, the male and female dies are switched so that the topside (front) of the sheet is pressed with the male die and the female die sits underneath it. When a deboss is registered to printing, one can create the appearance of engraving.
For the most part, presses that do embossing are interchangeable with presses that do foiling. Both processes require a lot of pressure and, for certain effects, a heated plate. Moreover, foiling and embossing are most often done together and so it makes sense to have a machine that can handle both.
Color harmony is the theory of combining colors in a fashion that is harmonious to the eye. In other words, what colors work well together. It is the reason the Hulk wears purple pants. It is the reason the original X-Men had yellow and blue uniforms. It is the reason behind almost all color design decisions.
Color Wheel
Color harmony is based on the concept of a color wheel. You can study up on the history of it here. Essentially, it is a wheel with all the colors formed in a circle. Primary colors are on three equally distanced points of the wheel. Typically these are Red, Blue and Yellow. In the field of painting, where the color wheel originated, these three primary colors were used to mix almost all other colors. In modern printing these are replaced with Magenta, Cyan and Yellow. Black is thrown in to create darker colors, thus C, M, Y, K.Between the three primary colors on the wheel are their mixed colors—purple between red and blue, orange between red and yellow, green between yellow and blue. Theoretically, all colors feels somewhere on the wheel.
The wheel represents color in a circle. Closer to the middle of the circle, colors are less pure. At the outer edge of the circle, they are more pure and more saturated. In 3D representations of the color wheel, one might add darkness and lightness separate from saturation. The thing that is important to know in color harmony is that how dark or light or how saturated colors are does not affect their position on the wheel. Orange can range from a dark brown, to a bright orange to a pale skin tone. All of these are ORANGE when it comes to the color wheel.
(As a side note, this is a great color wheel for designers to have.)
Key Color
After the color wheel itself, the next important thing to understand is the key color. The key color is the most important color of your design. It is the color you can’t change or the color of the element you want to draw attention to. If you are doing a painting of the Hulk, your key color is green as it is the color you can’t change. If you are doing a photograph of a person, then their skin tone is your key color. If you are doing product photography, then the color of your product is the key color.When determining your color harmony, you need to first determine your key color. From there, you can look at the various types of harmony and see which one you like best or which best suits your design.
Direct Harmony
This is the most basic harmony. It is a point opposite to the key color on the wheel. This “opposite” color is referred to as the complementary color and thus the direct harmony can also be called the complementary harmony. Virtually all color harmonies (except Analogous) are a variation of the direct harmony. It is the reason the wheel exists as opposed to a different kind of chart.The high contrast of complementary colors creates a vibrant look especially when used at full saturation but can be jarring if not managed properly. This is the most common color scheme and is easy to find in all sorts of designs. Hulk’s green color has purple as its complementary color—which is the reason he wears purple shorts. Red and green are the Christmas colors and also happen to be complementary colors to each other. In photography, blue is considered the best color to put behind a person as it is the complementary color to skin tone.
Complementary color schemes are tricky to use in large doses, but work well when you want something to stand out. Complementary colors are really bad for text as both colors have a similar “strength” and will fight for attention.
More examples