Skip to content

Instantly share code, notes, and snippets.

@eftalyurtseven
Created December 31, 2012 10:59
Show Gist options
  • Save eftalyurtseven/4419006 to your computer and use it in GitHub Desktop.
Save eftalyurtseven/4419006 to your computer and use it in GitHub Desktop.
jQuery ile Method yazmak ve jStyle Methodu
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Eftal Yurtseven Method Kullanımı</title>
<link rel="stylesheet" href="style.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="jStyle.js"></script>
<script type="text/javascript">
$(function(){
$("#wrapper").click(function(){
$(this).jStyle("deneme","#998855","1px solid #887744", "14px Segoe UI", "#fff");
$(this).jStyle2("deneme", "20","20");
});
});
</script>
</head>
<body>
<!-- Wrapper -->
<div id="wrapper" class="deneme">
Eftal Yurtseven &raquo; Method Kullanımı
</div>
<!--#Wrapper -->
</body>
</html>
$(function(){
$.fn.jStyle = function(elementClass,backgroundColor, border, font, fontColor){
$("."+elementClass).css({
"background-color" : backgroundColor,
"border" : border,
"font" : font,
"color" : fontColor
});
}
$.fn.jStyle2 = function(elementClass, padding, margin){
$("."+elementClass).css({
"margin" : margin,
"padding" : padding
});
}
});
/*
* Eftal Yurtseven
*/
body{margin: 0; padding: 0; background: #984532}
*{margin: 0; padding: 0; list-style-type: none; border: none}
#wrapper{width: 1000px; margin: 20px auto; background: #fff; font: 12px Segoe UI; padding: 10px}/*
* Eftal Yurtseven
*/
body{margin: 0; padding: 0; background: #984532}
*{margin: 0; padding: 0; list-style-type: none; border: none}
#wrapper{width: 1000px; margin: 20px auto; background: #fff; font: 12px Segoe UI; padding: 10px}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment