My Schedule
Jquery Image Slider
File Upload
Jquery Validator
Pagination
Search
The Art Of Learning
Sunday, 19 April 2015
Saturday, 18 April 2015
My Perspective
To do coding helps you understand the code rather than just copying the code from the developer, I know it seems like simple logic but some people think that just copying and pasting code would help them develop their coding skills. I uses to have that type of thinking but have now learnt the dangers of being like that you just don't learn what you want to when you do copy and paste developers code.
So on goes the learning on goes the learning......
To do coding helps you understand the code rather than just copying the code from the developer, I know it seems like simple logic but some people think that just copying and pasting code would help them develop their coding skills. I uses to have that type of thinking but have now learnt the dangers of being like that you just don't learn what you want to when you do copy and paste developers code.
So on goes the learning on goes the learning......
What I realise from watching videos from coders on youtube is that they make alot of mistakes and they still continue without realising their mistakes so you have to be careful when watching programming videos.
It really frustrated me as I was trying to learn how to validator using jquery some of the coding I was learning wasn't working, learning this at the end of the tutorial.
So that left me struck for quiet a while slowly taking up my time then i came with a theory a conclusion that the person your taking your knowledge from could be wrong.
In other news, i really enjoying coding and look to get better at it. Below is the code to what i did.
<!DOCTYPE html>
<html> <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script>
$(function(){
function init(){
v= $("#myForm").validate({
rules :{
name:{
required:true,
minlength:2,
maxlength:10,
},
age:{
required:true,
number:true,
},
url:{
required:true
},
agree_1:{
required:true
},
agree_2:{
required:true
}
},
messages :{
name:{
required:"Dont forget your name !",
minlength:$.validator.format("We nee more than {0} ")
}
},
success: function(element){
element.remove();
}
});
}
$.validator.setDefaults({
errorClass :'form-error',
errorElement :'div'
});
$.extend($.validator.messages,{
required:"Go and get him kid",
});
$("#myForm").submit(function(){
var valid=$("#myForm").valid();
if (valid){
$.post('save.php',$(this).serialize(),function(o){
if(o.error=false){
window.location.href='success.php';
}else{
}
},'json');
}
return false;
});
});
</script>
<style>
p {padding:2px;}
</style>
</head>
<body>
<div id="content">
<form id="myForm" method="post" action="" >
<p>Name: <input type="text" class="required"name="name"id="name"></p>
<p>Age : <input type="text" class="required"name="age" id="age"></p>
<p>URL: <input type="text"class="required" name="url"id="url"></p>
<p>Agree_1:
<input type="checkbox" class="required" name="agree_1" id="agree_3">
<label for="agree_3"></label>
</p>
<p>Agree_2:
<input type="checkbox" class="required"name="agree_2" id="agree_2">
</p>
<input type="submit" name="submit" value="Submit">
</form>
</div>
</body>
</html>
Regards
It really frustrated me as I was trying to learn how to validator using jquery some of the coding I was learning wasn't working, learning this at the end of the tutorial.
So that left me struck for quiet a while slowly taking up my time then i came with a theory a conclusion that the person your taking your knowledge from could be wrong.
In other news, i really enjoying coding and look to get better at it. Below is the code to what i did.
<!DOCTYPE html>
<html> <head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script>
$(function(){
function init(){
v= $("#myForm").validate({
rules :{
name:{
required:true,
minlength:2,
maxlength:10,
},
age:{
required:true,
number:true,
},
url:{
required:true
},
agree_1:{
required:true
},
agree_2:{
required:true
}
},
messages :{
name:{
required:"Dont forget your name !",
minlength:$.validator.format("We nee more than {0} ")
}
},
success: function(element){
element.remove();
}
});
}
$.validator.setDefaults({
errorClass :'form-error',
errorElement :'div'
});
$.extend($.validator.messages,{
required:"Go and get him kid",
});
$("#myForm").submit(function(){
var valid=$("#myForm").valid();
if (valid){
$.post('save.php',$(this).serialize(),function(o){
if(o.error=false){
window.location.href='success.php';
}else{
}
},'json');
}
return false;
});
});
</script>
<style>
p {padding:2px;}
</style>
</head>
<body>
<div id="content">
<form id="myForm" method="post" action="" >
<p>Name: <input type="text" class="required"name="name"id="name"></p>
<p>Age : <input type="text" class="required"name="age" id="age"></p>
<p>URL: <input type="text"class="required" name="url"id="url"></p>
<p>Agree_1:
<input type="checkbox" class="required" name="agree_1" id="agree_3">
<label for="agree_3"></label>
</p>
<p>Agree_2:
<input type="checkbox" class="required"name="agree_2" id="agree_2">
</p>
<input type="submit" name="submit" value="Submit">
</form>
</div>
</body>
</html>
Regards
Friday, 17 April 2015
If you have a passion for learning then learning jquery is something that is incredibly easy to learn and enjoyable.
I learnt how to do jquery slide show in the early hours of today once I finish it felt like I had score a goal in the champion league final (refers about champion league was due to my love for football) . Thats how coding can feel you can gain so much joy out of it when you complete a task. For me it is not a job it is hobbie that i truely in joy.
Here is the code i did for my slide show using jquery
$(document).ready(function() {
var width=720;
var animationSpeed= 400;
var pause=3000;
var currentSlide=1;
var $slider = $('#slider');
var $sliderContainer = $slider.find('.slides');
var $slides =$sliderContainer.find('.slide');
var interval;
function startSlider(){
interval = setInterval(function(){
$sliderContainer.animate({'margin-left':'-='+width},animationSpeed,function(){
currentSlide++;
if (currentSlide==$slides.length ){
currentSlide=1;
$sliderContainer.css('margin-left',0);
}
});
},pause);
}
function stopSlider(){
clearInterval(interval);
}
$slider.on('mouseenter',stopSlider).on('mouseleave',startSlider );
startSlider();
I learnt how to do jquery slide show in the early hours of today once I finish it felt like I had score a goal in the champion league final (refers about champion league was due to my love for football) . Thats how coding can feel you can gain so much joy out of it when you complete a task. For me it is not a job it is hobbie that i truely in joy.
Here is the code i did for my slide show using jquery
$(document).ready(function() {
var width=720;
var animationSpeed= 400;
var pause=3000;
var currentSlide=1;
var $slider = $('#slider');
var $sliderContainer = $slider.find('.slides');
var $slides =$sliderContainer.find('.slide');
var interval;
function startSlider(){
interval = setInterval(function(){
$sliderContainer.animate({'margin-left':'-='+width},animationSpeed,function(){
currentSlide++;
if (currentSlide==$slides.length ){
currentSlide=1;
$sliderContainer.css('margin-left',0);
}
});
},pause);
}
function stopSlider(){
clearInterval(interval);
}
$slider.on('mouseenter',stopSlider).on('mouseleave',startSlider );
startSlider();
});
Thursday, 16 April 2015
Today on the 17th of April 2015
I am going to be working on how to do silde show using the programming language called jquery. There are many reason why people prefer to do javascript using jquery one being it makes coding script shorter.
I am going to look at the different ways a silde show could be done, by looking at different programmers videos.
https://www.youtube.com/watch?v=KkzVFB3Ba_o
I started off by giving my self 2 images to design for the sildeshow, so that i could improve my photoshop skills along the way. I watched one of tutvids video and different channel. Two images i created for my jquery silder.
I am going to be working on how to do silde show using the programming language called jquery. There are many reason why people prefer to do javascript using jquery one being it makes coding script shorter.
I am going to look at the different ways a silde show could be done, by looking at different programmers videos.
https://www.youtube.com/watch?v=KkzVFB3Ba_o
I started off by giving my self 2 images to design for the sildeshow, so that i could improve my photoshop skills along the way. I watched one of tutvids video and different channel. Two images i created for my jquery silder.
Subscribe to:
Posts (Atom)

