Documente Academic
Documente Profesional
Documente Cultură
____________________________________________________________________________
it defines a way that the structure can be accessed from programs so that
they can change the document structure, style and content. The DOM
provides a representation of the document as a structured group of nodes
and objects that have properties and methods. Essentially, it connects web
pages to scripts or programming languages.
The DOM is a fully object-oriented representation of the web page, and it can
be modified with a scripting language such as JavaScript.
what are sprites and how do you implement them in you page ?
____________________________________________________________________________
how would you implement a web design comp that uses non-standard fonts?
You can store the css for the font a local directory on the web server and then
declare it with font-face in the css.
____________________________________________________________________________
Box-sizing follows the box model in that you have the content area first, then
padding, followed by border BUT NOT INCLUDING MARGINS. Thats right
box-sizing doesnt account for margins.
However, when you set a width or the height for the element, that is now the
total width or height for that element as a whole. So instead of having to add
padding and border onto the set width, you are subtracting it in order to
obtain the actual content area. Lets look at the formulas: width = total
element width and width padding border = content area width.
.box {
box-sizing: border-box; /* Opera/IE 8+ */
cover
Scale the background image to be as large as possible so that the
background area is completely covered by the background image. Some
parts of
the background image may not be in view within the background
positioning
area
contain
Scale the image to the largest size such that both its width and its
can fit inside the content area
height
Contain
So, in order to make our image fit the viewport, we can make the image
being contained in the viewport and have padding. Think black bars when
you are watching a movie.
Cover
There is another possibility, you can also make the image cover the viewport.
____________________________________________________________________________
article[data-columns='3']{
width: 400px;
}
Custom data attributes:
are strings you can store anything which can be string encoded, such as
JSON. Type conversion must be handled in JavaScript.
should only be used when no suitable HTML5 element or attribute exists.
are private to the page. Unlike microformats, they should be ignored by
external systems such as search engine indexing bots.
____________________________________________________________________________
columns or rows.
Javascript scope
We might say that it refers to your current location. Global scope / locat scope
____________________________________________________________________________
what would you use in jquery: $ or jQuery ?
I would use jQuery.
detach() keeps all jQuery data associated with the removed elements. This
method is useful when removed elements are to be reinserted into the DOM
at a later time.
____________________________________________________________________________
what is chaining ?
Chaining allows us to run multiple jQuery methods (on the same element)
within a single statement.This way, browsers do not have to find the same
element(s) more than once.
To chain an action, you simply append the action to the previous action.
$("#p1").css("color", "red").slideUp(2000).slideDown(2000);
____________________________________________________________________________
difference between attr(') and prop();
$.fn.prop() grabs the specified DOM property, while $.fn.attr() grabs the
specified HTML attribute.
____________________________________________________________________________
First one is a function that launches on click on the element that has class
link.
Sintax is wrong for second one
____________________________________________________________________________
when is the resize() function called ?
On the resize of the window.
____________________________________________________________________________
difference between width() and css(width, ...);
width() gets the width without units, for example : 400
css(width) hets the width with pixels
____________________________________________________________________________
explain the animate function in jQuery;
33
console.log(3+1 +2);
312
____________________________________________________________________________
a = 5;
b = 6;
a = b = 7;
console.log(angel);
____________________________________________________________________________
write
css selector that has margin-top: 10px; margin: bottom: 12px; margin-left:
11px; margin-right: 13px;
.text{
margin: 10px 13px 12px 11px;
}
____________________________________________________________________________
write
an animate function that sets the opacity of div with class test and ID box to
0.5, over a 0.5 sec and adding a class of new-class after the animation is
finished
jQuery(".test#box").animate({
opacity: 0.5
},500, function(){
jQuery(this).addClass("new-class");
});
____________________________________________________________________________
if ( jQuery(".old-class").find(".some-class").length > 0) {
}
____________________________________________________________________________
write
a function that calculates the margin of the div with the class of some-div