JQuery scroll up down event function

Автор: Administrator.

function fun(el, curScrlTop){
 if(curScrlTop - lastScrollTop < 0){...}
 lastScrollTop = curScrlTop;

JQuery when stop scrolling event function

Автор: Administrator.

$(window).scroll(function() {
 clearTimeout($.data(this, 'scrollTimer'));
 $.data(this, 'scrollTimer', setTimeout(function() {
 }, 40));

CSS View and Hide div block information by title click

Автор: Administrator.

После клика по элементу с классом project-title следующий элемент с классом project-info будет сперва скрыт, а по еще одному клику по project-title раскрыт с анимацией длительностью 700мс.


C# add application in autorun (regedit | реестр)

Автор: Administrator.

private static void autorun()
 const string name = "my_app";
 string ExePath = Application.ExecutablePath;
 RegistryKey reg;
 reg = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Run\");
 reg.SetValue(name, """ + ExePath + "" /hide");

C# Run Console application hidden

Автор: Administrator.

Change the output type from Console Application to Windows Application. This can be done underProject -> Properties -> Application in Visual Studio:

js function set default param value (параметр по умолчанию)

Автор: Administrator.

function showMessage(from, text) {
if (text === undefined) {
 text = 'текст не передан';
 alert(from + ": " + text);
showMessage("Маша", "Привет!"); // Маша: Привет!
showMessage("Маша"); // Маша: текст не передан

Второй вариант: 

function showMessage(from, text) {
 text = text || 'текст не передан';

IE11+ meta X-UA-Compatible проблемы совместимости

Автор: Administrator.

<code><!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> 

The X-UA-Compatible meta tag allows web authors to choose what version of Internet Explorer the page should be rendered as. IE11+ have changes to these modes. See IE11 note below.
Here are your options:

Search input text

Автор: Administrator.

<input type="text" placeholder="search" />

C++. CString to string

CString str = "12345";
std::string str2(static_cast<const char*>(str));
str = str2.c_str();

JS oop objects properties, prototype sample

Автор: Administrator.

function Widget(size,containerId,html,rowNumber){
 this.size = size;
 this.containerId = containerId;
 this.container = $(this.containerId);
 this.html = html;
 this.rowNumber = rowNumber;
 this.rowId = 'row' + this.rowNumber;
Widget.prototype = {
 render: function(){
 this.row = $('#' + this.rowId);
 var div = $('<div></div>').addClass('col-md-' + this.size).text(this.html);
 this.row = $('<div></div>').addClass('row').attr('id', this.rowId);
var widgets = [];
widgets.push(new Widget(5,'#container','vjvjy',2));
widgets.push(new Widget(3,'#container','343456',1));
widgets.push(new Widget(3,'#container','343456',2));
function Render(){
 for(var i = 0; i< widgets.length;i++){

Is Element Visible on screen (display) JS

Автор: Administrator.

function <strong>isElementVisible</strong>(elementToBeChecked)
   var TopView = $(window).scrollTop();
   var BotView = TopView + $(window).height();
   var TopElement = $(elementToBeChecked).offset().top;
   var BotElement = TopElement + $(elementToBeChecked).height();
   return ((BotElement = TopView));
function map_diagram(el){
      $(el).animate({'width': '360px',opacity: 1}, 1000);

@media for mobile device zoom

Автор: Administrator.

@media only screen and (max-device-width: 1024px) { 
     body { zoom: 0.8;} 

Detecting browsers javascript hacks

Автор: Administrator.

/Firefox detector 2/3 by DoctorDan
//Firefox 3 by me:-
FF3=(function x(){})[-5]=='x'
//Firefox 2 by me:-
FF2=(function x(){})[-6]=='x'
//IE detector I posted previously
//Safari detector by me
//Chrome by me
//Opera by me
Op=/^function (/.test([].sort)
//IE6 detector using conditionals 
try {IE6=@cc_on @_jscript_version

loader for site

Автор: Administrator.


<div id="loader">
<p id="loader_text ">
#loader{height: 100%;left: 50%;position: fixed;top: 40%;width: 100%;z-index: 9999;}
.loader_text {
font-family: 'Open Sans', sans-serif;
font-size: 20px;
width: 150px;
height: 40px;
background: silver;
color: green;
text-align: center;
padding-top: 10px;
opacity: 0.7;
border-radius: 5%;
overflow: hidden;
jQuery(window).load(function() { 
if('v'=='v'){IEoperation();} //if IE

Built with HTML5 and CSS3 | Copyright © 2012 - 2015 Зарембо Александр