Skip to content
Advertisement

Tag: jquery

Make a DIV and all children elements smaller

I want to re-size a part of HTML in my design. I need this change to happen as an animation. The DIV itself and all it’s inner elements i.e. Images, Paragraphs, Anchors etc should be re-sized just like when you re-size an image with a constant aspect ratio. I think, the tool should get current height and width of element

Hide or remove a div class at mobile viewport?

First and foremost, I am very aware of CSS media queries. My problem is this: When you have div classes stacked in one div; Example: And you want to remove “class2” @media (max-width: 768px) Creating an output of: …once the 768px threshold has been reached. So far I have come up with nothing other than this non-functional code: I am

capturing enter key in select2

I’m using select2 to present an editable selectbox. When user writes a statement which does not appear in the list(select2, data), I show a button to add this statement to the list. Forcing users to click the button seems to me a little bit frustration. Is it possible to capture enter key in select2? I want to make user able

Using `this` for Parent Function inside a Nested Function

In the Apple “classs”, how can the nested function countSeeds() retrieve the value this.price? jsfiddle: http://jsfiddle.net/VGqEa/ Output Answer put var self = this at the top of Apple, and then refer to this as self instead in the nested function. i.e.: You could also put the self=this statement at the beginning of this.cutOpen, since this will still refer to the

Onclick event on list item

I’m trying to follow this answer, but rather than using a button as he does in his jsfiddle, I’m trying to use list items: http://jsfiddle.net/hqvDT/108/ It looks like it should work, but when I try to select some text and then press B (for bold), it doesn’t actually bold the text. What’s wrong? HTML: CSS: JS: Answer The problem is

Advertisement