$(document).ready(function () {
var selects = $('select'), ln = selects.length;
for(var i = 0; i < ln; i++) {
var loc = $(selects[i]), tmenu ;
loc.selectmenu();
tmenu = '#' + loc .attr('id') + '-menu';
var style = loc.data('style');
$(tmenu).parent().addClass(style);
}
});
createPreloading: function() {
QueryLoader.preloader = $("<div></div>").appendTo(QueryLoader.selectorPreload);
$(QueryLoader.preloader).css({
height: "0px",
width: "0px",
overflow: "hidden"
});
var length = QueryLoader.items.length;
QueryLoader.doneStatus = length;
for (var i = 0; i < length; i++) {
var imgLoad = $("<img></img>");
$(imgLoad).attr("src", QueryLoader.items[i]);
$(imgLoad).unbind("load");
$(imgLoad).bind("load", function() {
QueryLoader.imgCallback();
});
$(imgLoad).bind("error", function () {
console.warn(this.src + ' картинка не найдена!');
QueryLoader.imgCallback();
});
$(imgLoad).appendTo($(QueryLoader.preloader));
}
}
$(document).ready(function () {
var close = function() {
var player = $('iframe'), video = player.attr("src");
player.attr("src","");
player.attr("src", video);
}
$(document).on('click', '.fancybox-close', function () {
close();
});
});
function close() {
$('#player').get(0).stopVideo();
}
<div class="wrap">
<div class="video-responsive">
<iframe width="auto" height="auto" src="http://www.youtube.com/embed/mRrE8CFkkAg" frameborder="0" allowfullscreen></iframe>
</div>
</div>
<div class="wrap">
<div class="video-responsive">
<iframe width="auto" height="auto" src="http://www.youtube.com/embed/mRrE8CFkkAg" frameborder="0" allowfullscreen></iframe>
</div>
</div>
.video-responsive {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow:hidden;
}
.video-responsive iframe,
.video-responsive object,
.video-responsive embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.wrap {
position: relative;
min-width: 300px;
max-width: 800px;
}
var app = angular.module("App", [])
.value("test", {})
.controller("first", ['$scope', '$testFactory', function ($scope, $testFactory) {
var test = $testFactory.setTest(1);
console.log(test);
}])
.controller("second",['$scope', '$testFactory', function ($scope, $testFactory) {
var test = $testFactory.setTest(2);
console.log(test);
}])
.factory('$testFactory', [function () {
var test = 0;
return {
setTest: function (val) {
test = val
return test;
}
}
}]);
.menu-item-has-children a:after {
content: "\f0d7";
margin: 2px 0px 0px 6px;
display: inline-block;
opacity: 0.5;
font-family: FontAwesome;
}
.menu-item-has-children a:after {
content: "\f0d7";
margin: 2px 0px 0px 6px;
opacity: 0.5;
font-family: FontAwesome;
}
"content_scripts": [{
"matches":["http://vk.com/*"],
"css":["css/style.css"],
"js":["js/base.js"]
}]
function autoResize(selector) {
var newheight, newwidth, frame = document.querySelector(selector);
if (frame) {
newheight = frame.contentWindow.document.body.scrollHeight;
newwidth = frame.contentWindow.document.body.scrollWidth;
frame.height= (newheight) + "px";
frame.width= (newwidth) + "px";
} else {
console.warn('Не чего не найдено!');
}
}
<html ng-app="App">
<body ng-controller="baseController">
<textarea name="notCrypt" ng-model="noCript"></textarea>
<textarea name="crypt">{{noCript|cript}}</textarea>
</body>
</html>
var app = angular.module("App", []).
controller("baseController",['$scope', function ($scope) {
$scope.noCrypt = "";
}]).
filter('cript', function () {
return function(input) {
// и вот тут, перед выводом, вы можете делать с вашим кодом все что вы захотите в том числе и кодировать
return input;
}
});
<ul class="menu">
<li><a href="#tab1" data-toggle="modal" data-target="#myModal">О Компании</a></li>
<li><a href="#tab2" data-toggle="modal" data-target="#myModal">Доставка и оплата</a></li>
<li><a href="#tab3" data-toggle="modal" data-target="#myModal">Наши гарантии</a></li>
</ul>
<div class="modal-body">
<div id="tab1" class="tab__content">Tab1</div>
<div id="tab2" class="tab__content">Tab2</div>
<div id="tab3" class="tab__content">Tab3</div>
</div>
$(document).ready(function () {
var allBlocks = $('.tab__content');
$(document).on('click', '.menu a', function () {
var el = $(this), id = el.attr('href');
allBlocks.css('display', 'none');
$('.modal-body').find(id).css('display', 'block');
return false;
});
});
<ul class="menu">
<li><a href="#tab1" data-toggle="modal" data-target="#myModal">О Компании</a></li>
<li><a href="#tab2" data-toggle="modal" data-target="#myModal">Доставка и оплата</a></li>
<li><a href="#tab3" data-toggle="modal" data-target="#myModal">Наши гарантии</a></li>
</ul>
<div class="modal-body">
<div id="tab-content">По дефолту контент первого таба</div>
</div>
$(document).ready(function () {
var target = $('#tab-content');
$(document).on('click', '.menu a', function () {
var el = $(this), id = el.attr('href');
//тут либо get либо post
$.post('url', {'tabid': id}, function (response) {
target.html(response);
});
return false;
});
});