노마드오브

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

2018/10/12 2

jQuery - jQuery를 사용하여 css 적용하는 방법

DOCTYPE html>Insert title here$(document).ready(function () {var color = ['red', 'blue', 'purple']; var c = $('h1').css('color');//alert(c);//$('h1').css('color', 'yellow'); // $('h1').css('color', function (index) {// return color[index];// });$('h1').css({color: function (index) {return color[index]},backgroundColor: 'black'}); });head-0head-1head-2

IT/jQuery 2018.10.12

jQuery $('img').attr('src')

DOCTYPE html> Insert title here $(document).ready(function () { var s = $('img').attr('src'); // alert(s); // $('img').attr('width', 200); // $('img').attr('width', function (index) { // return (index+1)*100; // }); // $('img').attr({ // width: 300, // height: 200 // }); $('img').attr({ width: function (index) { return (index+1)*100 }, height: 200 }); });

IT/jQuery 2018.10.12
이전
1
다음
더보기
프로필사진

노마드오브

  • 분류 전체보기 (238)
    • IT (236)
      • Java (107)
      • Mysql (8)
      • Oracle (27)
      • Android (39)
      • Jsp (21)
      • jQuery (16)
      • JavaScript (5)
      • Html (2)
      • Css (6)
      • maven (4)
      • spring (1)
      • etc (0)
    • Travelling (2)
      • 2018 Santiago (2)
    • Cat (0)
    • Stag beetle (0)

Tag

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2018/10   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바