نوشته شده توسط سرکار خانم شهاب
آدرس کوتاه: https://sitedar.com/?p=7936
از این افکت جالب که کدهای آن در زیر درج شده می توانید جهت نمایش دادن مطالب در سایت استفاده نمایید.
کدهای HTML:
<div class=”item” id=”item-1″>
<h1><strong><span style=”font-size: 36pt;”>We Speak Your</span></strong></h1>
<p>Thanks to an amazingly diverse team spread across 4 continents, we actually speak your language. </p>
</div>
<div class=”item” id=”item-2″>
<h1><strong><span style=”font-size: 36pt;”>Education</span></strong></h1>
<p>We provide our traders with great tools such as the Dow Jones Newswire, Trading Central & our MT4 Booster Pack.</p>
</div>
<div class=”item” id=”item-3″>
<h1><strong><span style=”font-size: 36pt;”>Tools</span></strong></h1>
<p>We’ve developed outstanding trading education systems to take you from zero to hero trading.</p>
</div>
<div class=”item” id=”item-4″>
<h1><strong><span style=”font-size: 36pt;”>Established In</span></strong></h1>
<p>We provide our traders with great tools such as the Dow Jones Newswire, Trading Central & our MT4 Booster Pack.</p>
</div>
کدهای CSS:
کدهای JS:
var dgr = 0;
var counter = 0;
$(“.bac-show-more”).click(function(){
dgr = dgr + 180;
$(‘.bg-content3-4’).attr(‘style’,’transform: rotate(‘+dgr+’deg);transition: 1s’);
var all_item_number = 0;
$(“.item”).each(function(){
all_item_number++;
});
$(‘.right-content’).hide(500);
$(‘.left-content’).hide(500);
counter++;
var content_one = $(‘#item-‘+counter).html();
$(‘.right-content’).html(content_one);
$(‘.right-content’).show(500);
counter++;
var content_second = $(‘#item-‘+counter).html();
$(‘.left-content’).html(content_second);
$(‘.left-content’).show(500);
if(counter >= all_item_number){
counter = 0;
}
});
var runAllow = true;
$(“.bac-show-more”).mouseenter(function () {
var point = ‘center’;
var direction = ‘left’;
runAllow = true;
$(“.bac-show-more”).addClass(‘rotate-rigth’);
var intrvl = setInterval(function () {
if(runAllow){
if(point == ‘center’){
if(direction == ‘left’){
point = ‘left’;
}
else{
point = ‘right’;
}
$(“.bac-show-more”).addClass(‘rotate-center’);
$(“.bac-show-more”).removeClass(‘rotate-left’);
$(“.bac-show-more”).removeClass(‘rotate-rigth’);
}
else if(point == ‘left’){
point = ‘center’;
direction = ‘right’;
$(“.bac-show-more”).addClass(‘rotate-left’);
$(“.bac-show-more”).removeClass(‘rotate-rigth’);
$(“.bac-show-more”).removeClass(‘rotate-center’);
}
else if(point == ‘right’){
point = ‘center’;
direction = ‘left’;
$(“.bac-show-more”).addClass(‘rotate-rigth’);
$(“.bac-show-more”).removeClass(‘rotate-left’);
$(“.bac-show-more”).removeClass(‘rotate-center’);
}
}
else{
clearInterval(intrvl);
}
}, 1000);
});
$(“.bac-show-more”).mouseleave(function(){
runAllow = false;
$(“.bac-show-more”).removeClass(‘rotate-rigth’);
$(“.bac-show-more”).removeClass(‘rotate-left’);
$(“.bac-show-more”).removeClass(‘rotate-center’);
clearInterval(intrvl);
});
$(‘.bac-show-more’).click(function(){
if ($(‘.right-content’).hasClass(“addcolor”)) {
$(‘.right-content’).removeClass(‘addcolor’);
}
else {
$(‘.right-content’).addClass(‘addcolor’);
}
if ($(‘.left-content’).hasClass(“removecolor”)) {
$(‘.left-content’).removeClass(‘removecolor’);
}
else {
$(‘.left-content’).addClass(‘removecolor’);
}
});