Javascriptle span veya bir div içerisinde karakter sınırlaması yapmak
Backendden gelen “lorem ipsum dolor” içeriğini html yüklenirken saydırıp karakter limiti 10’u geçiyorsa kesip sonuna elipsis “…” ekliyoruz.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script><script type="text/javascript">// <![CDATA[ $(document).ready(function() { var substrText = function(text, max, endFix) { var textLength = text.length, endFix = endFix || "…"; if (textLength > max) { return text.substr(0, max) + endFix; } } var $box = $("#box"), text = substrText("lorem ipsum dolor", 10); $box.text(text); }); // ]]></script> |
Güzel bilgi fakat javaScript kodların yorumlanıp kaynak koda geçmişler, haberin olsun. Ellerine sağlık. :)
Hi Neto. This is just a Jquery directory of pnluigs and tutorials. You might need to contact the plugin author through CodeCanyon.They have a great community that deals with those issues and I’m sure you can find help there.
Eyvallah:) Blogla henüz uğraşamadım, yakın zamanda toparlayacağım içeriği.
if you are entering all sletceed values of selectbox as comma seperated in mysql database, than you can retrieve that field. Explode it and check for each selectbox value with database value if value is in database array than make it sletceed.