list of german university......link
Resources of TOEFL/GRE ....link
রবিবার, ২৪ এপ্রিল, ২০১১
বৃহস্পতিবার, ২১ এপ্রিল, ২০১১
show hide panel by jquery
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
if($("button").html() == 'show'){
$("button").html("hide");
}
else {
$("button").html("show");
}
$(".panel").slideToggle("slow");
});
});
</script>
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p> you can study everything you need to learn, in an accessible and handy format.</p>
</div>
<button>show</button>
</body>
</html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
if($("button").html() == 'show'){
$("button").html("hide");
}
else {
$("button").html("show");
}
$(".panel").slideToggle("slow");
});
});
</script>
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p> you can study everything you need to learn, in an accessible and handy format.</p>
</div>
<button>show</button>
</body>
</html>
Countable text area
jquery.simplyCountable.js
(function($){
$.fn.simplyCountable = function(options){
options = $.extend({
counter: '#counter',
countType: 'characters',
wordSeparator: ' ',
maxCount: 256,
strictMax: false,
countDirection: 'down',
safeClass: 'safe',
overClass: 'over',
thousandSeparator: ',',
onOverCount: function(){},
onSafeCount: function(){},
onMaxCount: function(){}
}, options);
var countable = this;
var counter = $(options.counter);
if (!counter.length) { return false; }
var regex = new RegExp('['+options.wordSeparator+']+');
var countCheck = function(){
var count;
var revCount;
var reverseCount = function(ct){
return ct - (ct*2) + options.maxCount;
}
var countInt = function(){
var text = countable.val();
for (var i = 0; i < text.length; i++) {
var charCode = text.charCodeAt(i);
//utf-8 character count
if (charCode == 10 || charCode == 13) {
if ($.browser.msie) {
count -= 1;
}
}
else if (charCode > 127 && charCode < 2048) {
count -= 2;
} else if (charCode > 2047 && charCode < 65536) {
count -= 3;
} else if (charCode > 65535 && charCode < 1114112) {
count -= 4;
}
}
return (options.countDirection === 'up') ? revCount : count;
}
var numberFormat = function(ct){
if (options.thousandSeparator){
ct = ct.toString();
for (var i = ct.length-3; i > 0; i -= 3){
if((ct.length%4)==0 && ct.charAt(0)=='-'){
ct = ct;
} else {
ct = ct.substr(0,i) + options.thousandSeparator + ct.substr(i);
}
}
}
return ct;
}
/* Calculates count for either words or characters */
if (options.countType === 'words'){
count = options.maxCount - $.trim(countable.val()).split(regex).length;
if (countable.val() === ''){ count += 1; }
}
else { count = options.maxCount - countable.val().length; }
revCount = reverseCount(count);
/* If strictMax set restrict further characters */
if (options.strictMax && count <= 0){
var content = countable.val();
if (count < 0 || content.match(new RegExp('['+options.wordSeparator+']$'))) {
options.onMaxCount(countInt(), countable, counter);
}
if (options.countType === 'words'){
countable.val(content.split(regex).slice(0, options.maxCount).join(options.wordSeparator));
}
else { countable.val(content.substring(0, options.maxCount)); }
count = 0, revCount = options.maxCount;
}
counter.text(numberFormat(countInt()));
/* Set CSS class rules and API callbacks */
if (!counter.hasClass(options.safeClass) && !counter.hasClass(options.overClass)){
if (count < 0){ counter.addClass(options.overClass); }
else { counter.addClass(options.safeClass); }
}
else if (count < 0 && counter.hasClass(options.safeClass)){
counter.removeClass(options.safeClass).addClass(options.overClass);
options.onOverCount(countInt(), countable, counter);
}
else if (count >= 0 && counter.hasClass(options.overClass)){
counter.removeClass(options.overClass).addClass(options.safeClass);
options.onSafeCount(countInt(), countable, counter);
}
};
countCheck();
countable.keyup(countCheck);
countable.keypress(countCheck);
countable.click(countCheck);
countable.mouseover(countCheck);
};
})(jQuery);
main.gsp(for layout)
<g:javascript library="jquery" plugin="jquery"/>
<script type="text/javascript" src="${resource(dir: 'js', file: 'jquery.simplyCountable.js')}"></script>
<head>
…..............
…........
<style type="text/css" media="screen">
.safe {
color: green;
}
.over {
color: red;
}
</style>
<script>
jQuery.noConflict();
jQuery(document).ready(function () {
jQuery('textarea').map(function() {
if (jQuery(this).attr("floor") == 1) {
var id = jQuery(this).attr("id");
jQuery('#' + id).live('keydown',ND.utils.textCounter);
jQuery('#' + id).live('keyup',ND.utils.textCounter);
jQuery('#' + id).live('focus',ND.utils.textCounter);
}
});
});
</script>
….......
….........
</head>
For textarea in any .gsp
<g:countableTextArea name="medicalInfo" id="medicalInfo_countable" class="field" cols="25" rows="4" floor="1"
length="3000" value="${ifspTypeInfoInstance?.medicalInfo}"/>
NB:
1. floor means active for textarea countable...............
2. length means max length.
Taglib......
def countableTextArea = { attrs, body ->
def escapeHtml = true
if (attrs.escapeHtml) escapeHtml = Boolean.valueOf(attrs.remove('escapeHtml'))
// Pull out the value to use as content not attrib
def value = attrs.remove('value')
if (!value) {
value = body()
}
out << """<textarea """
attrs.each { k, v ->
out << "$k=\"${v.encodeAsHTML()}\" "
}
out << """ >""" <<"""${escapeHtml ? value.encodeAsHTML() :value}</textarea>"""
def check = Integer.valueOf(attrs.remove('floor'))
if (check == 1) {
out << """<p style="margin: 0;"> <span id="${attrs.id}-counter"> </span> </p>"""
}
}
(function($){
$.fn.simplyCountable = function(options){
options = $.extend({
counter: '#counter',
countType: 'characters',
wordSeparator: ' ',
maxCount: 256,
strictMax: false,
countDirection: 'down',
safeClass: 'safe',
overClass: 'over',
thousandSeparator: ',',
onOverCount: function(){},
onSafeCount: function(){},
onMaxCount: function(){}
}, options);
var countable = this;
var counter = $(options.counter);
if (!counter.length) { return false; }
var regex = new RegExp('['+options.wordSeparator+']+');
var countCheck = function(){
var count;
var revCount;
var reverseCount = function(ct){
return ct - (ct*2) + options.maxCount;
}
var countInt = function(){
var text = countable.val();
for (var i = 0; i < text.length; i++) {
var charCode = text.charCodeAt(i);
//utf-8 character count
if (charCode == 10 || charCode == 13) {
if ($.browser.msie) {
count -= 1;
}
}
else if (charCode > 127 && charCode < 2048) {
count -= 2;
} else if (charCode > 2047 && charCode < 65536) {
count -= 3;
} else if (charCode > 65535 && charCode < 1114112) {
count -= 4;
}
}
return (options.countDirection === 'up') ? revCount : count;
}
var numberFormat = function(ct){
if (options.thousandSeparator){
ct = ct.toString();
for (var i = ct.length-3; i > 0; i -= 3){
if((ct.length%4)==0 && ct.charAt(0)=='-'){
ct = ct;
} else {
ct = ct.substr(0,i) + options.thousandSeparator + ct.substr(i);
}
}
}
return ct;
}
/* Calculates count for either words or characters */
if (options.countType === 'words'){
count = options.maxCount - $.trim(countable.val()).split(regex).length;
if (countable.val() === ''){ count += 1; }
}
else { count = options.maxCount - countable.val().length; }
revCount = reverseCount(count);
/* If strictMax set restrict further characters */
if (options.strictMax && count <= 0){
var content = countable.val();
if (count < 0 || content.match(new RegExp('['+options.wordSeparator+']$'))) {
options.onMaxCount(countInt(), countable, counter);
}
if (options.countType === 'words'){
countable.val(content.split(regex).slice(0, options.maxCount).join(options.wordSeparator));
}
else { countable.val(content.substring(0, options.maxCount)); }
count = 0, revCount = options.maxCount;
}
counter.text(numberFormat(countInt()));
/* Set CSS class rules and API callbacks */
if (!counter.hasClass(options.safeClass) && !counter.hasClass(options.overClass)){
if (count < 0){ counter.addClass(options.overClass); }
else { counter.addClass(options.safeClass); }
}
else if (count < 0 && counter.hasClass(options.safeClass)){
counter.removeClass(options.safeClass).addClass(options.overClass);
options.onOverCount(countInt(), countable, counter);
}
else if (count >= 0 && counter.hasClass(options.overClass)){
counter.removeClass(options.overClass).addClass(options.safeClass);
options.onSafeCount(countInt(), countable, counter);
}
};
countCheck();
countable.keyup(countCheck);
countable.keypress(countCheck);
countable.click(countCheck);
countable.mouseover(countCheck);
};
})(jQuery);
main.gsp(for layout)
<g:javascript library="jquery" plugin="jquery"/>
<script type="text/javascript" src="${resource(dir: 'js', file: 'jquery.simplyCountable.js')}"></script>
<head>
…..............
…........
<style type="text/css" media="screen">
.safe {
color: green;
}
.over {
color: red;
}
</style>
<script>
jQuery.noConflict();
jQuery(document).ready(function () {
jQuery('textarea').map(function() {
if (jQuery(this).attr("floor") == 1) {
var id = jQuery(this).attr("id");
jQuery('#' + id).live('keydown',ND.utils.textCounter);
jQuery('#' + id).live('keyup',ND.utils.textCounter);
jQuery('#' + id).live('focus',ND.utils.textCounter);
}
});
});
</script>
….......
….........
</head>
For textarea in any .gsp
<g:countableTextArea name="medicalInfo" id="medicalInfo_countable" class="field" cols="25" rows="4" floor="1"
length="3000" value="${ifspTypeInfoInstance?.medicalInfo}"/>
NB:
1. floor means active for textarea countable...............
2. length means max length.
Taglib......
def countableTextArea = { attrs, body ->
def escapeHtml = true
if (attrs.escapeHtml) escapeHtml = Boolean.valueOf(attrs.remove('escapeHtml'))
// Pull out the value to use as content not attrib
def value = attrs.remove('value')
if (!value) {
value = body()
}
out << """<textarea """
attrs.each { k, v ->
out << "$k=\"${v.encodeAsHTML()}\" "
}
out << """ >""" <<"""${escapeHtml ? value.encodeAsHTML() :value}</textarea>"""
def check = Integer.valueOf(attrs.remove('floor'))
if (check == 1) {
out << """<p style="margin: 0;"> <span id="${attrs.id}-counter"> </span> </p>"""
}
}
বুধবার, ২০ এপ্রিল, ২০১১
two or three jquery in same page
if you have two or three jquery in same page, just put a different variable for different jquery..example :
<script type="text/javascript">
var $s = jQuery.noConflict();
$s(document).ready(function() {
$s('#news-container').vTicker({
speed: 500,
pause: 3000,
animation: 'fade',
mousePause: true,
showItems: 2
});
});
</script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j('.sf-menu ul').superfish({
delay: 1000,
animation: {opacity:'show',height:'show'},
speed: 'medium',
autoArrows: false,
dropShadows: 'medium'
});
});
</script>
courtesy.....
<script type="text/javascript">
var $s = jQuery.noConflict();
$s(document).ready(function() {
$s('#news-container').vTicker({
speed: 500,
pause: 3000,
animation: 'fade',
mousePause: true,
showItems: 2
});
});
</script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j('.sf-menu ul').superfish({
delay: 1000,
animation: {opacity:'show',height:'show'},
speed: 'medium',
autoArrows: false,
dropShadows: 'medium'
});
});
</script>
courtesy.....
বুধবার, ৬ এপ্রিল, ২০১১
মঙ্গলবার, ৫ এপ্রিল, ২০১১
grails important blog/link list
1. http://www.intelligrape.com/blog/category/grails/
2. For Symbole http://gavingrover.blogspot.com/2008/02/grerl-vys-and-groovys-symbols-part-2.html
3. Assert
4. Conditional validation in domain class ........details
5. Grails and the Pagination Bugaboo.......link
6. Dynamic jasper report in grails लिंक
7. export plugin problem solved by लिंक
8 . pdf css .....link
9. jquery-multiselect.js for multiple select combo box link-->
10. Grails AJAX Examples link
11. grails prevent multiple submition using useToken link
12. How to use onLoading event in grails remoteFunction link
13. Online Groovy Console link
14. http://csetyro.blogspot.com/2011/07/restfull-in-grails.html
15. Projection sum and group by link
2. For Symbole http://gavingrover.blogspot.com/2008/02/grerl-vys-and-groovys-symbols-part-2.html
3. Assert
4. Conditional validation in domain class ........details
5. Grails and the Pagination Bugaboo.......link
6. Dynamic jasper report in grails लिंक
7. export plugin problem solved by लिंक
8 . pdf css .....link
9. jquery-multiselect.js for multiple select combo box link-->
10. Grails AJAX Examples link
11. grails prevent multiple submition using useToken link
12. How to use onLoading event in grails remoteFunction link
13. Online Groovy Console link
14. http://csetyro.blogspot.com/2011/07/restfull-in-grails.html
15. Projection sum and group by link
এতে সদস্যতা:
পোস্টগুলি (Atom)