, , jQuery :
$('div').not(':first').hide();
$('div a').click(
function(e){
e.preventDefault();
var that = $(this).closest('div'),
duration = 1200;
if (that.next('div').length){
that.fadeOut(duration,
function(){
that.next('div').fadeIn(duration);
});
}
});
JS Fiddle demo.
OP, :
, , , href target = _blank?
, . , , , - a ( href a), window.open():
$('div').not(':first').hide();
$('div a').click(
function(e){
e.preventDefault();
var newWin = window.open(this.href,'newWindow'),
that = $(this).closest('div'),
duration = 1200;
if (that.next('div').length){
that.fadeOut(duration,
function(){
that.next('div').fadeIn(duration);
});
}
});
JS Fiddle demo.
, script, Roko , " " ( , , , /):
$('div').not(':first').hide();
$('div a').click(
function(e){
e.preventDefault();
var newWin = window.open(this.href,'newWin'),
that = $(this).closest('div'),
duration = 1200;
if (that.next('div').length){
that.fadeOut(duration,
function(){
that.next('div').fadeIn(duration);
});
}
else {
that.fadeOut(duration,
function(){
that.prevAll('div:last').fadeIn(duration);
});
}
});
JS Fiddle demo.
: