$(".each-avatar .avatar").click(function(){
$(this).next().animate({height: 'show'}, 500);
});
$(".each-avatar .info-block").click(function(){
$(this).animate({height: 'hide'}, 500);
});
});
webView.getSettings().setUseWideViewPort(false);
...
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
return false;
}
@Override
public boolean onDoubleTap(MotionEvent e) {
//Тут вернем true, тем самым игнорим двойной клик
return true;
}
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
return true;
}
<div class="item">
<img src="http://lorempixel.com/400/300/" alt="">
<div class="wrap-text">
<div>
<h2>Заголовок второго уровня</h2>
<p>Lorem ipsum dolor sit amet, consectetur<br> adipisicing elit. Ipsam, deleniti.</p></div>
</div>
</div>
.wrap-text {
position: absolute;
width: 100%;
top: 13px;
padding: 0 10px;
}
.wrap-text > div {
padding: 10px;
background: red;
}
.item {
position: relative;
float: left;
width: calc(33.33333% - 20px);
margin-right: 20px;
}
Intent intent = new Intent(getBaseContext(), NewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
var find = function (arr, find) {
return arr.filter(function (value) {
return value === find;
});
};
var arr = ["a", -1, 2, "b"];
console.log(find(arr, -1));
var result = find(arr, 2);
[2]
var find = function (arr, find) {
return arr.filter(function (value) {
return (value + "").indexOf(find) != -1;
});
};
var arr = ["a", -1, 2, "bulka"];
console.log(find(arr, "b"));
var numberInput = document.getElementById("number");
var inputsCount = 0;
numberInput.onchange = function() {
var value = this.value;
if (this.value === 0) {
var last = area.lastChild;
area.removeChild(last);
return;
}
if (value < 0) {
value = 0;
this.value = value;
}
if (value < inputsCount) {
var last = area.lastChild;
area.removeChild(last);
}
if(value > inputsCount){
var inputNew = document.createElement('input');
area.appendChild(inputNew);
}
inputsCount = value;
};
public class SlidingFrameLayout extends FrameLayout
{
private static final String TAG = SlidingFrameLayout.class.getName();
public SlidingFrameLayout(Context context) {
super(context);
}
public SlidingFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public float getXFraction()
{
int width = getWindowManager().getDefaultDisplay().getWidth();
return (width == 0) ? 0 : getX() / (float) width;
}
public void setXFraction(float xFraction) {
int width = getWindowManager().getDefaultDisplay().getWidth();
setX((width > 0) ? (xFraction * width) : 0);
}
}
<objectAnimator
xmlns:android="http://schemas.android.com/apk/res/android"
android:propertyName="xFraction"
android:valueType="floatType"
android:valueFrom="0"
android:valueTo="0.25"
android:duration="500"/>
private int state = 0;
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (state == 0) {
//показываем первый кусок
state = 1;
}
else if (state == 1) {
//показываем второй кусок
state = 2
}
else {
//тут действие по умолчанию
}
}
});
$rs="SELECT * FROM `pany` WHERE `link` <> '$link' LIMIT 1";
$rs="SELECT * FROM `pany` WHERE NOT `link` = '$link' LIMIT 1";
import React from 'react/addons'
import Router, {Route, DefaultRoute, RouteHandler, Link} from 'react-router';
import RouterContainer from './services/RouterContainer';
const { CSSTransitionGroup } = React.addons;
class PageOne extends React.Component {
render() {
return (
<div className="Image">
<h1>Page 1</h1>
<p>Тут контентик для первой страницы!</p>
</div>
)
}
}
class PageTwo extends React.Component {
render() {
return (
<div className="Image">
<h1>Page 2</h1>
<p>Тут контентик для второй страницы</p>
</div>
)
}
}
class App extends React.Component {
render() {
var key = RouterContainer.getRoute();
return (
<div>
<ul>
<li>
<Link to="/page1">Page 1</Link>
</li>
<li>
<Link to="/page2">Page 2</Link>
</li>
</ul>
<CSSTransitionGroup component="div" transitionName="example">
<RouteHandler key={key}/>
</CSSTransitionGroup>
</div>
);
}
}
//Create router config
var routes = (
<Route handler={App} >
<Route name="page1" handler={PageOne} />
<Route name="page2" handler={PageTwo} />
</Route>
);
var router = Router.create({routes});
RouterContainer.set(router);
(function (w, d, R) {
router.run(function (Handler) {
React.render(<Handler />, d.querySelector('#example'));
});
}(window, document, React));
.Image {
position: absolute;
height: 400px;
width: 400px;
}
.example-enter {
opacity: 0.01;
transition: opacity .5s ease-in;
}
.example-enter.example-enter-active {
opacity: 1;
}
.example-leave {
opacity: 1;
transition: opacity .5s ease-in;
}
.example-leave.example-leave-active {
opacity: 0;
}
.link-active {
color: #bbbbbb;
text-decoration: none;
}
.video_block iframe {
position: relative;
z-index: -1;
}
var jsonObj = {'Account': 'Vasja', 'Date': '02/10/2015', 'Id' : '78234324234'};
var jsonString = JSON.stringify(jsonObj);
console.log(JSON.parse(jsonString.toLowerCase()));