IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

Intégrer popup à un lien href


Sujet :

HTML

  1. #1
    Membre du Club
    Homme Profil pro
    Consultant Marketing
    Inscrit en
    Mars 2016
    Messages
    285
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Belgique

    Informations professionnelles :
    Activité : Consultant Marketing
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2016
    Messages : 285
    Points : 57
    Points
    57
    Par défaut Intégrer popup à un lien href
    Bonjour,

    J'ai sur ma page d'accueil une balise <a href="#">Read More</a> et je voudrais intégrer un code que j'ai récupérer sur le net ( un popup ) à cette balise.

    Pouvez vous m'aider à l'intégrer ? car j'ai déjà mon css et je ne vois pas comment faire.

    mon code de ma page d'accueil :

    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    <section class="Home" id="home">
            <!--<h2 class="all-heading">Home <span>Section</span></h2>-->
            <div class="container">
                <div class="box" style="--clr:#89ec5b;">
                    <div class="content">
                        <div class="icon"><ion-icon name="brush-outline"></ion-icon></div>
                        <div class="text">
                            <h3>Card1</h3>
                            <pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
                            <a href="#">Read More</a>
                        </div>
                    </div>
                </div>
                <div class="box" style="--clr:#eb5ae5;">
                    <div class="content">
                        <div class="icon"><ion-icon name="code-slash-outline"></ion-icon></div>
                        <div class="text">
                            <h3>Card2</h3>
                            <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
                            <a href="#">Read More</a>
                        </div>
                    </div>
                </div>
                <div class="box" style="--clr:#5b98eb;">
                    <div class="content">
                        <div class="icon"><ion-icon name="search-outline"></ion-icon></div>
                        <div class="text">
                            <h3>Card3</h3>
                            <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
                            <a href="#">Read More</a>
                        </div>
                    </div>
                </div>
            </div>
        </section>

    Mon fichier style.css :

    Code css : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    .container {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        padding: 60px 0;
        gap: 60px;
    }
     
    .container .box {
        position: relative;
        width: 300px;
        height: 350px;
        background: #2e2e2e;
        display: flex;
        justify-content: center;
        align-items: center;
    }
     
    .container .box::before {
        content: '';
        position: absolute;
        inset: -10px 50px;
        border-top: 4px solid var(--clr);
        border-bottom: 4px solid var(--clr);
        z-index: -1;
        transform: skewY(15deg);
        transition: 0.5s ease-in-out;
    }
     
    .container .box:hover::before {
        transform: skewY(0deg);
        inset: -10px 40px;
    }
     
    .container .box::after {
        content: '';
        position: absolute;
        inset: 60px -10px;
        border-left: 4px solid var(--clr);
        border-right: 4px solid var(--clr);
        z-index: -1;
        transform: skew(15deg);
        transition: 0.5s ease-in-out;
    }
     
    .container .box:hover::after {
        transform: skew(0deg);
        inset: 40px -10px;
    }
     
    .container .box .content {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 0 20px;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
     
    .container .box .content .icon {
        color: var(--clr);
        width: 80px;
        height: 80px;
        box-shadow: 0 0 0 4px #2e2e2e,
            0 0 0 6px var(--clr);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 3.5em;
        background: #2e2e2e;
        transition: 0.5s ease-in-out;
    }
     
    .container .box:hover .content .icon {
        background: var(--clr);
        color: #2e2e2e;
        box-shadow: 0 0 0 4px #2e2e2e,
            0 0 0 300px var(--clr);
    }
     
    .container .box .content .text h3 {
        font-size: 2.5em;
        color: #fff;
        font-weight: 500;
        transition: 0.5s ease-in-out;
    }
     
    .container .box:hover .content .text h3 {
        color: #2e2e2e;
    }
     
    .container .box .content .text p {
        font-size: 1.5em;
        color: #999;
        transition: 0.5s ease-in-out;
    }
     
    .container .box:hover .content .text p {
        color: #2e2e2e;
    }
     
    .container .box .content .text a {
        position: relative;
        font-size: 1.6em;
        background: var(--clr);
        color: #2e2e2e;
        padding: 8px 15px;
        display: inline-block;
        text-decoration: none;
        font-weight: 500;
        margin-top: 10px;
        transition: 0.5s ease-in-out;
    }
     
    .container .box:hover .content .text a {
        background: #2e2e2e;
        color: var(--clr);
    }

    Le code que je voudrais intégrer à mon lien :
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    <!-- Stylesheet file -->
    <link rel="stylesheet" href="css/style.css">
     
    <!-- jQuery library -->
    <script src="js/jquery.min.js"></script>
     
    </head>
    <body>
    <div class="container">
        <h2>Popup Contact Form with Email</h2>
     
        <!-- Trigger/Open The Modal -->
        <button id="mbtn" class="btn btn-primary turned-button">Contact Us</button>
     
        <!-- The Modal -->
        <div id="modalDialog" class="modal">
            <div class="modal-content animate-top">
                <div class="modal-header">
                    <h5 class="modal-title">Contact Us</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <form method="post" id="contactFrm">
                <div class="modal-body">
                    <!-- Form submission status -->
                    <div class="response"></div>
     
                    <!-- Contact form -->
                    <div class="form-group">
                        <label>Name:</label>
                        <input type="text" name="name" id="name" class="form-control" placeholder="Enter your name" required="">
                    </div>
                    <div class="form-group">
                        <label>Email:</label>
                        <input type="email" name="email" id="email" class="form-control" placeholder="Enter your email" required="">
                    </div>
                    <div class="form-group">
                        <label>Message:</label>
                        <textarea name="message" id="message" class="form-control" placeholder="Your message here" rows="6"></textarea>
                    </div>
                </div>
                <div class="modal-footer">
                    <!-- Submit button -->
                    <button type="submit" class="btn btn-primary">Submit</button>
                </div>
                </form>
            </div>
        </div>
    </div>
     
    <script>
    $(document).ready(function(){
        $('#contactFrm').submit(function(e){
            e.preventDefault();
            $('.modal-body').css('opacity', '0.5');
            $('.btn').prop('disabled', true);
            
            $form = $(this);
            $.ajax({
                type: "POST",
                url: 'ajax_submit.php',
                data: 'contact_submit=1&'+$form.serialize(),
                dataType: 'json',
                success: function(response){
                    if(response.status == 1){
                        $('#contactFrm')[0].reset();
                        $('.response').html('<div class="alert alert-success">'+response.message+'</div>');
                    }else{
                        $('.response').html('<div class="alert alert-danger">'+response.message+'</div>');
                    }
                    $('.modal-body').css('opacity', '');
                    $('.btn').prop('disabled', false);
                }
            });
        });
    });
     
     
    /*
     * Modal popup
     */
    // Get the modal
    var modal = $('#modalDialog');
     
    // Get the button that opens the modal
    var btn = $("#mbtn");
     
    // Get the <span> element that closes the modal
    var span = $(".close");
     
    $(document).ready(function(){
        // When the user clicks the button, open the modal 
        btn.on('click', function() {
            modal.show();
        });
        
        // When the user clicks on <span> (x), close the modal
        span.on('click', function() {
            modal.hide();
        });
    });
     
    // When the user clicks anywhere outside of the modal, close it
    $('body').bind('click', function(e){
        if($(e.target).hasClass("modal")){
            modal.hide();
        }
    });
    </script>
    </body>
    </html>

    Le css du code à integrer :

    Code css : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    .container{
      padding: 20px;
    }
    ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
      color: #969494;
    }
    ::-moz-placeholder { /* Firefox 19+ */
      color: #969494;
    }
    :-ms-input-placeholder { /* IE 10+ */
      color: #969494;
    }
    :-moz-placeholder { /* Firefox 18- */
      color: #969494;
    }
     
     
    .animate-top{
      position:relative;
      animation:animatetop 0.4s
    }
    @keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}}
     
    .modal {
      display: none;
      position: fixed;
      z-index: 1;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgb(0,0,0);
      background-color: rgba(0,0,0,0.4);
    }
     
    .modal-content {
      margin: 8% auto;
      border: 1px solid #888;
      width: 475px;
      background-color: #fff;
      border: 1px solid rgba(0,0,0,.2);
      border-radius: .3rem;
      outline: 0;
    }
    .modal-header {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: start;
        -ms-flex-align: start;
        align-items: flex-start;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        padding: 1rem;
        border-bottom: 1px solid #e9ecef;
        border-top-left-radius: .3rem;
        border-top-right-radius: .3rem;
    }
    .modal-title {
        margin-bottom: 0;
        line-height: 1.5;
        margin-top: 0;
    }
    h5.modal-title {
        font-size: 1.25rem;
        color: #666;
    }
    .close {
        float: right;
        font-size: 1.5rem;
        font-weight: 700;
        line-height: 1;
        color: #000;
        text-shadow: 0 1px 0 #fff;
        opacity: .5;
    }
    button.close {
        padding: 0;
        background-color: transparent;
        border: 0;
        -webkit-appearance: none;
    }
    .modal-header .close {
        padding: 1rem;
        margin: -1rem -1rem -1rem auto;
    }
    .close:not(:disabled):not(.disabled) {
        cursor: pointer;
    }
     
    .modal-body {
        flex: 1 1 auto;
        padding: 1rem;
    }
    .modal-body p {
        margin-top: 0;
        margin-bottom: 1rem;
    }
    .modal-footer {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: end;
        -ms-flex-pack: end;
        justify-content: flex-end;
        padding: 1rem;
        border-top: 1px solid #e9ecef;
    }
    .btn {
        display: inline-block;
        font-weight: 400;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        border: 1px solid transparent;
        padding: .375rem .75rem;
        font-size: 1rem;
        line-height: 1.5;
        border-radius: .25rem;
        transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
        cursor: pointer;
    }
    .btn-primary {
        color: #fff;
        background-color: #07a8ff;
        border-color: #07a8ff;
        display: block;
        margin: 0 auto;
    }
    .btn-primary:hover {
        color: #fff;
        background-color: #0069d9;
        border-color: #0062cc;
    }
    .btn:focus, .btn:hover {
        text-decoration: none;
    }
    h2{text-align: center;}
    .form-group {
        margin-bottom: 15px;
    }
    label {
        display: inline-block;
        max-width: 100%;
        margin-bottom: 5px;
        font-weight: 700;
    }
    .form-control {
        display: block;
        width: 95%;
        /*height: 34px;*/
        padding: 6px 12px;
        font-size: 14px;
        line-height: 1.42857143;
        color: #555;
        background-color: #fff;
        background-image: none;
        border: 1px solid #ccc;
        border-radius: 4px;
        -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
        -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
        transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    }
    .form-control:focus {
        border-color: #66afe9;
        outline: 0;
        -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6);
    }
     
    .alert {
        position: relative;
        padding: .75rem 1.25rem;
        margin-bottom: 1rem;
        border: 1px solid transparent;
        border-radius: .25rem;
    }
    .alert-success {
        color: #155724;
        background-color: #d4edda;
        border-color: #c3e6cb;
    }
    .alert-danger {
        color: #721c24;
        background-color: #f8d7da;
        border-color: #f5c6cb;
    }

  2. #2
    Membre du Club
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2022
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 20
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2022
    Messages : 33
    Points : 61
    Points
    61
    Par défaut
    Bonjour,
    Refait le par toi même non ? c'est plus simple et comme ca et t'es sur d'avoir compris comme faire ?

Discussions similaires

  1. Ouvrir un popup de formulaire apres clic sur un lien href
    Par aba2s dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 16/09/2019, 18h36
  2. Rechercher liens href dans un fichier
    Par ribrok dans le forum Langage
    Réponses: 5
    Dernier message: 27/09/2005, 17h15
  3. [HTML][PHP] Les liens href...
    Par hackrobat dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 31/03/2005, 11h28
  4. Transmettre une variable via un lien href
    Par developpeur_mehdi dans le forum Balisage (X)HTML et validation W3C
    Réponses: 6
    Dernier message: 08/01/2005, 14h49
  5. [Struts] Paramètres d'un lien (href)
    Par lanoix dans le forum Struts 1
    Réponses: 4
    Dernier message: 09/04/2004, 15h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo