הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 22-06-12, 11:00   # 1
danielkh
חבר בקהילה
 
danielkh's Avatar
 
מיני פרופיל
תאריך הצטרפות: May 2008
מיקום: פ"ת
הודעות: 101
שלח הודעה באמצעות ICO אל danielkh שלח הודעה באמצעות MSN אל danielkh

danielkh לא מחובר  

בעיה | קוד Jquery

שלום לכולם,

יש לי בעיה ממש מוזרה, אני מנסה להציג Popup שמאחוריו יוצג הרקע בשחור(הכל בjquery ולא פופאפ רגיל בhtml).
משום מה הPopup בלי הגדרה של הרקע מאחורה עובד(ראו קוד מצורף). וכאשר מגדירים את הDiv של הרקע בקוד ובפונקציה הPopup לא מופיע(ראו קוד מצורף פשוט תורידו את ההערות).
אשמח לקבל עזרה בהקדם תודה לכולם.

קוד:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication5.WebForm1" %>


<!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">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">


        $(document).ready(function () {


            $("#link").click(function () {
                loadPop();
                center();
            });


        });


        function loadPop() {


//            $("#backgroundPop").css({
//                "opacity": "0.5",
//                "background-color": "Black"
//            });


//            $("#backgroundPop").fadeIn('slow');
            $("#popup").fadeIn('slow');
            
        }


        function center() {


            var windowWidth = document.documentElement.clientWidth;
            var windowheight = document.documentElement.clientHeight;
            var popupWidth = $("#popup").width();
            var popupHeight = $("#popup").height();


            $("#popup").css({
                "position": "absolute",
                "top": 100,
                "left": windowWidth / 2 - popupWidth / 2
            });


//                 $("#backgroundPop").css({
//                "height": windowheight
//            });
        }
    </script>
</head>
<body>
    
    <form runat="server">
    <div id="div1" style="background-color:Red; width: 100%; height:300px;">
    </div>
    <div id="div2" style="background-color:yellow; width: 100%; height:300px;">
    <span id="link">דוגמהה</span>
    </div>
    <div id="div3" style="background-color:green; width: 100%; height:300px;">
    </div>
    <div id="popup" style="display: none; background-color: Black; color: White; height:300px; width:300px; z-index:1">
    kgjg
    </div>
    </form>
    <%--<div id="backgroundPop" style="height: 100%; width: 100%; position:fixed; top:0; left:0;">
    </div>--%>
</body>
</html>
__________________
דניאל חייט
054-2030807
E-mail: daniel@starttech.co.il

  Reply With Quote
ישן 22-06-12, 14:19   # 2
Haimz
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Sep 2010
הודעות: 1,221

Haimz לא מחובר  

הטעות שלך הייתה שהBACKGROUND נמצא על הטקסט, מה שיצר מצב שאתה חשבת שלחצת על הטקסט אבל בעצם לחצת על הרקע,
תיתן לרקע display none , כך:
קוד:
<div id="backgroundPop" style="display:none;height: 100%; width: 100%; position:fixed; top:0; left:0;">
    </div>
ולפונקצייה loadpop תוסיף:
קוד:
$("#backgroundPop").fadeIn('slow');
דוגמה: http://pastebin.me/9cb729b698f5239e99aac66dd5009ff6
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 09:48.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ