
02-07-2010, 13:12
|
|
|
|
חבר מתאריך: 15.07.02
הודעות: 1,027
|
|
|
עזרה עם jQuery
יש לי ידע דיי מועט בג'אווה לכן, לקחתי את הסקריפט הזה מאזישהו אתר של מדריכים..
ניתן לצפות בתוצאה כאן: www.g1000000.org/index.php
אני מנסה להתאים אותו לאתר שלי.. מדובר על וויג'ט חדשות מתגולל..
הנה הקוד מקור של הסקרפיט:
קוד PHP:
(function($) { $.fn.newsScroll = function(options) { return this.each(function() { var $this = $(this), defaults = { speed: 400, delay: 3000, list_item_height: $this.children('div').outerHeight() }, settings = $.extend({}, defaults, options); setInterval(function() { $this.children('div:first') .animate({ marginTop : '-' + settings.list_item_height, opacity: 'hide' }, settings.speed, function() { $this .children('div:first') .appendTo($this) .css('marginTop', 0) .fadeIn(300); } ); // end animate }, settings.delay); // end setInterval }); } })(jQuery);
והנה הקוד מקור של הHTML:
קוד PHP:
<div style="width:250px; background:#fff; box-shadow: 7px 7px 5px #888; -moz-box-shadow:7px 7px 5px #888; -moz-border-radius:1.2em; border-radius:1.2em; color:#cd5c5c; border:5px solid rgb(86, 100, 103); float:right; height:200px; margin-right:20px;"> <div style="height:20px; color:black; -moz-border-radius:2em; border-radius:2em; position:relative; width:100%; font-weight:bold; font-size:1.4em; border-bottom:4px solid #8b8378; background:#cdcdc1; text-align:center;"> חדשות האתר </div> <dl id="news" style="list-style:none;"> <?php $news = $this->getNews(); foreach ($news as $new) { ?> <div> <dt style="color:#b22222; display:box; text-shadow:10px 2px 5px #888; font-weight:bold; font-size:1.5em;"> <span style="color:#789;">(</span><?php echo $new['title']; ?><span style="color:#789;">)</span> </dt> <dd><a href="#" style=":hover {color: yellow}" ><?php echo $new['content']; ?></a></dd> <dd style="color:black" ><?php echo $new['date']; ?></dd> <dd style="color:black" >צפו בידיעה זו <?php echo $new['views']; ?> אנשים</dd> <hr style="height:0.6em; background:#789; color:black;" /> </div> <?php } ?> </dl> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.newsScroll.js"></script> <script type="text/javascript"> $('#news').newsScroll({ speed: 2000, delay: 5000 }); // or just call it like: // $('#widget').newsScroll(); </script> </div>
מישהו מוכן להסביר לי איך ניתן להסתיר את כל הטקסט שגולש מהקופסא?
תודה לעוזרים.
_____________________________________
ציטוט:
|
Different people use different tools, but its mostly morons who pretend that the problems with PHP actually matter.
|
|