النتائج 1 إلى 5 من 5

الموضوع: التحويل من CSS الى JavaScript

  1. #1
    خبير JavaScript
    تاريخ التسجيل
    Jul 2002
    المشاركات
    2,920

    التحويل من CSS الى JavaScript



    السلام عليكم

    هذه لا ئحة بأهم مراجع CSS وتحويلها الى JavaScript
    مثال
    بال background-color بال CSS لتحويلها الى الجافاسكريبت سنزيل علامة - ونكبر الحرف اذي يليها لتصبح backgroundColor
    هذا حتى نتحكم بها من خلال الجافاسكريبت، طريقة الإستعمال
    في انترنت اكسبلورر
    كود PHP:
    document.all.id.style.backgroundColor "القيمة"
    ولنتسكيب
    كود PHP:
    document.id.style.backgroundColor "القيمة"
    و لكل المتصفحات القياسية
    كود PHP:
    document.getElementById("id").style.backgroundColor "القيمة"
    وهنا ال id هي تعرفة المعلم التي نعطيها للوسم الذي نريد ان نتحكم في تنسيقه
    وهذه هي الائحة، على اليسار بال CSS في اليمين بال JavaScript
    كود PHP:
    background ->-> background
    background
    -attachment ->-> backgroundAttachment
    background
    -color ->-> backgroundColor
    background
    -image ->-> backgroundImage
    background
    -position ->-> backgroundPosition
    background
    -repeat ->-> backgroundRepeat
    border 
    ->-> border
    border
    -bottom ->-> borderBottom
    border
    -bottom-color ->-> borderBottomColor
    border
    -bottom-style ->-> borderBottomStyle
    border
    -bottom-width ->-> borderBottomWidth
    border
    -color ->-> borderColor
    border
    -left ->-> borderLeft
    border
    -left-color ->-> borderLeftColor
    border
    -left-style ->-> borderLeftStyle
    border
    -left-width ->-> borderLeftWidth
    border
    -right ->-> borderRight
    border
    -right-color ->-> borderRightColor
    border
    -right-style ->-> borderRightStyle
    border
    -right-width ->-> borderRightWidth
    border
    -style ->-> borderStyle
    border
    -top ->-> borderTop
    border
    -top-color ->-> borderTopColor
    border
    -top-style ->-> borderTopStyle
    border
    -top-width ->-> borderTopWidth
    border
    -width ->-> borderWidth
    clear 
    ->-> clear
    clip 
    ->-> clip
    color 
    ->-> color
    cursor 
    ->-> cursor
    display 
    ->-> display
    filter 
    ->-> filter
    font 
    ->-> font
    font
    -family ->-> fontFamily
    font
    -size ->-> fontSize
    font
    -variant ->-> fontVariant
    font
    -weight ->-> fontWeight
    height 
    ->-> height
    left 
    ->-> left
    letter
    -spacing ->-> letterSpacing
    line
    -height ->-> lineHeight
    list-style ->-> listStyle
    list-style-image ->-> listStyleImage
    list-style-position ->-> listStylePosition
    list-style-type ->-> listStyleType
    margin 
    ->-> margin
    margin
    -bottom ->-> marginBottom
    margin
    -left ->-> marginLeft
    margin
    -right ->-> marginRight
    margin
    -top ->-> marginTop
    overflow 
    ->-> overflow
    padding 
    ->-> padding
    padding
    -bottom ->-> paddingBottom
    padding
    -left ->-> paddingLeft
    padding
    -right ->-> paddingRight
    padding
    -top ->-> paddingTop
    page
    -break-after ->-> pageBreakAfter
    page
    -break-before ->-> pageBreakBefore
    position 
    ->-> position
    float 
    ->-> styleFloat
    text
    -align ->-> textAlign
    text
    -decoration ->-> textDecoration
    text
    -decorationblink ->-> textDecorationBlink
    text
    -decorationline-through ->-> textDecorationLineThrough
    text
    -decorationnone ->-> textDecorationNone
    text
    -decorationoverline ->-> textDecorationOverline
    text
    -decorationunderline ->-> textDecorationUnderline
    text
    -indent ->-> textIndent
    text
    -transform ->-> textTransform
    top 
    ->-> top
    vertical
    -align ->-> verticalAlign
    visibility 
    ->-> visibility
    width 
    ->-> width
    z
    -index ->-> zIndex 








  2. #2
    عضو نشيط جدا
    تاريخ التسجيل
    May 2006
    المشاركات
    354


    حلو يا زيزوار ما شاء الله
    هذه الصفحه ساطبعها واستخدمها كمرجع
    شكرا لك






  3. #3
    عضو سوبر نشيط
    تاريخ التسجيل
    Aug 2004
    المشاركات
    723


    معلومة جديدة ومفيدة اخوي زيزوار
    ياحبذا لو تعطينا تطبيق عملي بسيط على كيفية تغيير background في الـ css
    من
    background-image: url("images/bg_2.jpg");
    إلى الجافا






  4. #4
    عضو نشيط
    تاريخ التسجيل
    May 2006
    المشاركات
    167


    جزاك الله خيرا أخي زيزوار

    أما بالنسبة لسؤاك أخي مشراق، فأنا لم أجربه للتأكد ولكني كتبته على السريع أتمنى أنه يشتغل،
    كود HTML:
    document.getElementById('elID').backgroundImage  = 'URI to ur image';






    __________________
    ------------------------
    Moving with the web 2.0h era

  5. #5
    خبير JavaScript
    تاريخ التسجيل
    Jul 2002
    المشاركات
    2,920


    بارك الله فيكم
    وشكرا للتوضيح أبوعوف
    أخي المشراق هذه هي القاعدة
    اتبع القاعدة التي فوق، وغير علامة : الى = أحصر القيمة بين علامتي التنصيص
    كود PHP:
    document.getElementById('elID').backgroundImage 'url("images/bg_2.jpg")'











ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض