في صفحة html أريد برمجة معينة، بحيث يتغير محتوى الصفحة عند الضغط على وسوم div معينة أو ما يصطلح عليه Tabs، ولأني غير خبير بـ Javascript، أريد السؤال عن إمكانية برمجة هذا السكربت، هذا الكود حرّرته بعد عملية بحث فر المواقع:
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<div class="why-container">
<div class="icon-nav">
<a class="link" href="#tab" data-link="first"><img src="img1.png" class="blue-icons"></a>
<a class="link" href="#tab" data-link="second"><img src="img2.png" class="blue-icons"></a>
<a class="link" href="#tab" data-link="third"><img src="img3.png" class="blue-icons"></a>
<a class="link" href="#tab" data-link="fourth"><img src="img4.png" class="blue-icons"></a>
</div>
<div class="why-content">
<div class="textWord_tab" data-link="first">
<div class="content-box">
<div class="content-box-header">Content Tab 1</div>
<p class="content-box-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
<div class="textWord_tab" data-link="second">
<div class="content-box">
<div class="content-box-header">Content Tab 2</div>
<p class="content-box-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
<div class="textWord_tab" data-link="third">
<div class="content-box">
<div class="content-box-header">Content Tab 3</div>
<p class="content-box-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
<div class="textWord_tab" data-link="fourth">
<div class="content-box">
<div class="content-box-header">Content Tab 4</div>
<p class="content-box-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$('.textWord_tab').hide();
$('.link').click(function () {
$('.textWord_tab').hide();
$('.textWord_tab[data-link=' + $(this).data('link') + ']').fadeIn({
width: '200px'
}, 300);
});
</script>
</body>
السؤال
K@m@l
في صفحة html أريد برمجة معينة، بحيث يتغير محتوى الصفحة عند الضغط على وسوم div معينة أو ما يصطلح عليه Tabs، ولأني غير خبير بـ Javascript، أريد السؤال عن إمكانية برمجة هذا السكربت، هذا الكود حرّرته بعد عملية بحث فر المواقع:
كيف أحصل على سكربت يعمل بالمميزات المطلوبة آنفا؟
1 جواب على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.