Today I am going to tell how to create Gmail Style Message Inbox Design with jQuery & CSS. From this design you can able to
- Add Star / Unstar Messages
- Delete Single Message
- Delete Multiple Messages
- Mark as Read
- Mark as Unread
This tutorial will bring you exactly look like gmail feature. Designers can easily integrate this code in your existing web projects. I hope everyone will like this tutorial.
Contents
Jquery Code to Check All/ Uncheck All
jQuery('.checkall').click(function(){
var parentTable = jQuery(this).parents('table');
var ch = parentTable.find('.checkbox');
if(jQuery(this).is(':checked')) {
//check all rows in table
ch.each(function(){
jQuery(this).attr('checked',true);
jQuery(this).parent().addClass('checked'); //used for the custom checkbox style
jQuery(this).parents('tr').addClass('selected'); // to highlight row as selected
});
} else {
//uncheck all rows in table
ch.each(function(){
jQuery(this).attr('checked',false);
jQuery(this).parent().removeClass('checked'); //used for the custom checkbox style
jQuery(this).parents('tr').removeClass('selected');
});
}
});
jQuery Code to Mark Star / Unstar
jQuery('.msgstar').click(function(){
if(jQuery(this).hasClass('starred'))
jQuery(this).removeClass('starred');
else
jQuery(this).addClass('starred');
});
jQuery Code to delete multiple messages
if(jQuery('.delete').length > 0) {
jQuery('.delete').click(function(){
var c = false;
var cn = 0;
var o = new Array();
jQuery('.mailinbox input:checkbox').each(function(){
if(jQuery(this).is(':checked')) {
c = true;
o[cn] = jQuery(this);
cn++;
}
});
if(!c) {
alert('No selected message');
} else {
var msg = (o.length > 1)? 'messages' : 'message';
if(confirm('Delete '+o.length+' '+msg+'?')) {
for(var a=0;a<cn;a++) {
jQuery(o[a]).parents('tr').remove();
}
}
}
});
}
jQuery Code to Mark as Read
jQuery('.mark_read').click(function(){
var c = false;
var cn = 0;
var o = new Array();
jQuery('.mailinbox input:checkbox').each(function(){
if(jQuery(this).is(':checked')) {
c = true;
o[cn] = jQuery(this);
cn++;
}
});
if(!c) {
alert('No selected message');
} else {
var msg = (o.length > 1)? 'messages' : 'message';
if(confirm('Mark '+o.length+' '+msg+' to read')) {
for(var a=0;a<cn;a++) {
jQuery(o[a]).parents('tr').removeClass('unread');
}
}
}
});
jQuery Code to Mark as Unread
jQuery('.mark_unread').click(function(){
var c = false;
var cn = 0;
var o = new Array();
jQuery('.mailinbox input:checkbox').each(function(){
if(jQuery(this).is(':checked')) {
c = true;
o[cn] = jQuery(this);
cn++;
}
});
if(!c) {
alert('No selected message');
} else {
var msg = (o.length > 1)? 'messages' : 'message';
if(confirm('Mark '+o.length+' '+msg+' to unread')) {
for(var a=0;a<cn;a++) {
jQuery(o[a]).parents('tr').addClass('unread');
}
}
}
});
Please don’t forget to share and subscribe to latest updates of the blog. Also any comments and feedback are all welcome!
Thanks!
Warning: mysql_connect(): Access denied for user ‘w3lesson_dev123’@’localhost’ (using password: YES) in /home/w3les3l4/public_html/demo/gmail-style-inbox/download.php on line 7
Connecting to MySQL failed
unable to download
Hi Naresh,
Issue has been sorted out
Thanks
Hi,
How to download this files ? I subscribe with my mail, therefore show me Email does not exist in our database. Please use below form to subscribe ?
Thanks in advance !
Hi,
is there anyway to make it like gmail, the menu in the top does not show until a checkbx is checked.
thanks.
Hey, update the list please!
its 3 days over i subscribed and still tels i am not in list… Sucks
please update the subscribers list yaaaaaaaaaaaaaaaaaaaaaaaaaaaa
why cant i download ?
Hi please update the subscribers list… i’ve subscribed for more than 20 hrs ago n unable to download….:(
please update subscribers list please 🙂
Fantastic…
Thank you a lot…
good like…
i cant download your script help me please
Great job!
Wonderful coding.
Update subscribers list please
Update subscribers list please
Karthikeyan K you are really a master. I’m learning more and will learn more. The login gadget is a big deal wow!
I was wondering for this Gmail Style Message Inbox Design how does it work for ages.
Wow! That’s a great work.
HI, I subscribed about 15 hours ago and cannot download either. Could you please updated the subscribers list again Karthikeyan?
Hi Marc, I have updated the subscribers database now.. please download it now..
Thanks
I have subscribed for 24 hours and can not download
Ahmed
Hello, I have subscribed for 11 hours and can not download. Says: “Email does not exist in our database. Please use form below to subscribe” but I am
Hello, I have subscribed for 11 hours and can not download. Says: “Email does not exist in our database. Please use form below to subscribe” but I am.
Hi Nelson,
Subscribers List has been updated.. please download it now..
Thanks
hello sir !!
i like your inbox design with jquery and css. it’s awesome…i love it..
i have subscribed your channel 5 hours ago.. but i have not downloading yet !!
Thank You sir!!
Thanks this looks good but I subscribed and confirmed 21 hours ago and it still won’t let me download. “Email does not exist in our database. Please use below form to subscribe”. If I try again to subscribe it says I’m already subscribed.
I have that problem to…
Subscribers List has been updated.. sorry for inconvenience
i cant able to download it..I have subscribed
hello sir
I have already subscribe but it doesn’t download………….
plz help me sir sooni m waiting
its really good ……..but how to download it ……………
First of all thx for this, really help, I just don’t get how to make it see as readed a message already read.
Again, thx!
Hi Karthik,
Thanks a lot for your support.This article helped me a lot and saved my timings
Hi Karthik,
I am unable to download this source file even when i am a subscribed user.
Hi Manjari
Just now I have updated the subscribers list.
Now you can download script from – http://w3lessons.info/demo/gmail-style-inbox
Thanks
Hi Karthik,
while tried to download the file,I am getting this below error..
“This shared file or folder link has been removed.”
can u please send me the source file ..
waiting for your reply…
How to connect to db with mysql and php?
i can’t download it even when i’m a subscribed user
Hi Danielvan,
Now you can download this script from – http://w3lessons.info/demo/gmail-style-inbox/
I have updated the subscribers list
Thanks
hi i have subscribed this 3 days before but i am unable to download the script. what is wrong?