jQuery cover image reposition after upload - php

Folowing this tutorial i try to implement on my app based on ZendFramework 2.
I create all what author say and when i test image is successfull uploaded and alias is saved in database. But problem is ajax not show reposition after uploading and not show image. I must refresh browser to see new image.
My code:
<script>
$(document).ready(function()
{
/* Uploading Profile BackGround Image */
$('body').on('change','#bgphotoimg', function()
{
$("#bgimageform").ajaxForm({target: '#timelineBackground',
beforeSubmit:function(){},
success:function(){
$("#timelineShade").hide();
$("#bgimageform").hide();
},
error:function(){
} }).submit();
});
/* Banner position drag */
$("body").on('mouseover','.headerimage',function ()
{
var y1 = $('#timelineBackground').height();
var y2 = $('.headerimage').height();
$(this).draggable({
scroll: false,
axis: "y",
drag: function(event, ui) {
if(ui.position.top >= 0)
{
ui.position.top = 0;
}
else if(ui.position.top <= y1 - y2)
{
ui.position.top = y1 - y2;
}
},
stop: function(event, ui)
{
}
});
});
/* Bannert Position Save*/
$("body").on('click','.bgSave',function ()
{
var id = $(this).attr("id");
var p = $("#timelineBGload").attr("style");
var Y =p.split("top:");
var Z=Y[1].split(";");
var dataString ='position='+Z[0];
$.ajax({
type: "POST",
url: "image_saveBG_ajax_bg.php",
data: dataString,
cache: false,
beforeSend: function(){ },
success: function(html)
{
if(html)
{
$(".bgImage").fadeOut('slow');
$(".bgSave").fadeOut('slow');
$("#timelineShade").fadeIn("slow");
$("#timelineBGload").removeClass("headerimage");
$("#timelineBGload").css({'margin-top':html});
return false;
}
}
});
return false;
});
});
</script>
#timelineBackground {
height: 315px;
position: relative;
margin-top: -20px;
overflow: hidden;
background-color:#ccc;
}
#timelineProfilePic {
width: 170px;
height: 170px;
background-color: #ffffff;
position: absolute;
margin-top: -145px;
margin-left: 20px;
z-index: 1000;
overflow: hidden;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
#timelineTitle {
color: #ffffff;
font-size: 24px;
margin-top: -45px;
position: absolute;
margin-left: 206px;
font-weight: bold;
text-rendering: optimizelegibility;
text-shadow: 0 0 3px rgba(0,0,0,.8);
z-index: 999;
text-transform: capitalize;
}
#timelineShade {
min-height: 95px;
position: absolute;
margin-top: -95px;
width: 100%;
}
#timelineNav {
background-color: #ffffff;
min-height: 43px;
margin-bottom: 10px;
position: relative;
}
.timelineUploadBG {
position: absolute;
margin-top: 50px;
margin-left: 813px;
height: 32px;
width: 32px;
}
.uploadFile {
background: url('../images/whitecam.png') no-repeat;
height: 32px;
width: 32px;
overflow: hidden;
cursor: pointer;
}
.uploadFile input {
filter: alpha(opacity=0);
opacity: 0;
margin-left: -110px;
}
.custom-file-input {
height: 25px;
cursor: pointer;
}
.bgImage,#timelineBGload
{
width:100%;
}
.headerimage {
cursor: s-resize;
position: absolute;
}
.wallbutton:hover {
text-decoration: none;
}
.blackButton {
background-color: #666666;
border-color: #333333;
}
.bgSave {
position: absolute;
margin-top: 267px;
margin-left: 760px;
z-index: 4000;
}
.wallbutton {
font-weight: bold;
padding: 7px 9px;
background-color: #5fcf80;
color: #fff !important;
font-size: 12px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
cursor: pointer;
text-decoration: none;
border-width: 1px 1px 3px !important;
border-style: solid;
border-color: #3ac162;
white-space: nowrap;
display: -moz-inline-stack;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
}
.bgSave {
position: absolute;
margin-top: 267px;
margin-left: 760px;
z-index: 4000;
}
.wallbutton {
font-weight: bold;
padding: 7px 9px;
background-color: #5fcf80;
color: #fff !important;
font-size: 12px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
cursor: pointer;
text-decoration: none;
border-width: 1px 1px 3px !important;
border-style: solid;
border-color: #3ac162;
white-space: nowrap;
display: -moz-inline-stack;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
}
<div class="image">
<div class="cover-img">
<div id="timelineBackground">
<?php if($cover = getCoverPicture($profile->account_id)): ?>
<?php $cover_image_path = upload_userdata_url() .'/'. $cover->account_id .'/'.'photos/'.$cover->photo_guid .'/'. $cover->photo_name;?>
<img style="margin-top: <?= $cover->photo_bg_position; ?>" class="bgImage" src="<?= $cover_image_path; ?>">
<?php endif; ?>
</div>
<div id="timelineShade" style="">
<form action="photo/uploadCoverPicture" enctype="multipart/form-data" method="post" id="bgimageform">
<div class="uploadFile timelineUploadBG">
<input type="file" original-title="Change Cover Picture" class=" custom-file-input" id="bgphotoimg" name="userfile">
</div>
</form>
</div>
</div>
</div>

Related

How to get the language from toggle?

I want do create a multilanguage site (English and German). The toggle works but I don't know how to get the language in order to select the language and to show the words in the right language.
How can I get the value of the toggle (if posible using PHP and not Javascript)?
Thanks in advance for any help.
--------------------------------
<!DOCTYPE HTML>
<html lang="de" html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="switch">
<input id="language-toggle" class="check-toggle check-toggle-round-flat" type="checkbox">
<label for="language-toggle"></label>
<span id="de" class="on">DE</span>
<span id="en" class="off">EN</span>
</div>
<?php
$lang = "en";
require_once("Language/lang.".$lang.".php");
?>
<p style="font-size:30px;"><?php echo $language["text1"]; ?></p>
</body>
</html>
---------------lang.de.php-------------------
<?php
$language['text1'] = 'Willkommen';
?>
---------------lang.en.php-------------------
<?php
$language['text1'] = 'Welcome';
?>
---------------------style.css-----------------------
.switch {
position: relative;
display: inline-block;
margin: -4px 0px;
line-height:45px;
}
.switch > span {
position: absolute;
top: 0px;
pointer-events: none;
font-family: 'Helvetica', Arial, sans-serif;
font-weight: bold;
font-size: 12px;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(0, 0, 0, .06);
width: 50%;
line-height:45px;
text-align: center;
}
input.check-toggle-round-flat:checked ~ .off {
color: #333;
}
input.check-toggle-round-flat:checked ~ .on {
color: #fff;
}
.switch > span.on {
left: 0;
padding-left: 2px;
color: #333;
}
.switch > span.off {
right: 0;
padding-right: 4px;
color: #fff;
}
.check-toggle {
position: absolute;
margin-left: -9999px;
visibility: hidden;
}
.check-toggle + label {
display: block;
position: relative;
cursor: pointer;
outline: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
input.check-toggle-round-flat + label {
padding: 2px;
width: 97px;
height: 35px;
background-color: #333;
-webkit-border-radius: 60px;
-moz-border-radius: 60px;
-ms-border-radius: 60px;
-o-border-radius: 60px;
border-radius: 60px;
}
input.check-toggle-round-flat + label:before, input.check-toggle-round-flat + label:after {
display: block;
position: absolute;
content: "";
}
input.check-toggle-round-flat + label:before {
top: 2px;
left: 2px;
bottom: 2px;
right: 2px;
background-color: #333;
-webkit-moz-border-radius: 60px;
-ms-border-radius: 60px;
-o-border-radius: 60px;
border-radius: 60px;
}
input.check-toggle-round-flat + label:after {
top: 4px;
left: 4px;
bottom: 4px;
width: 48px;
background-color: #fff;
-webkit-border-radius: 52px;
-moz-border-radius: 52px;
-ms-border-radius: 52px;
-o-border-radius: 52px;
border-radius: 52px;
-webkit-transition: margin 0.2s;
-moz-transition: margin 0.2s;
-o-transition: margin 0.2s;
transition: margin 0.2s;
}
input.check-toggle-round-flat:checked + label {
}
input.check-toggle-round-flat:checked + label:after {
margin-left: 44px;
}

Wordpress Ultimate Popup Plugin - Keep modal open even when clicked outside of?

I am using Ultimate Popup Plugin from CodeCanyon on this website Click here to create a login modal.
The code is working fine, but the popup stays even if someone clicks outside the popup, and the user must enter the details and click enter.
This is how it looks;
I tried providing a z-index to keep the popup on but I am stuck.
I had updated the code I have for the wordpress plugin whatever I could find.
This is the CSS and the JS of the popup:
jQuery(window).load(function(){
if (jQuery.cookie("popupTemporaryCookie13428")) {
// Popup is hiding after showing first time!
jQuery("#ultimate-popup-13428").hide();
} else if (jQuery.cookie("popupLongerCookie13428")) {
var inst = jQuery("#ultimate-popup-13428").remodal();
inst.open();
jQuery("#ultimate-popup-13428").addClass("ultimate-popup-wrapper-activate");
} else {
var inst = jQuery("#ultimate-popup-13428").remodal();
inst.open();
jQuery("#ultimate-popup-13428").addClass("ultimate-popup-wrapper-activate");
}
var expiresAt = new Date();
expiresAt.setTime(expiresAt.getTime() + 1*24*60*60*1000); // Days
jQuery.cookie("popupLongerCookie13428", new Date());
jQuery.cookie("popupTemporaryCookie13428", true, { expires: expiresAt });
});
* {
box-sizing: border-box;
}
*:before,
*:after {
box-sizing: border-box;
}
.ultimate-popup-wrapper {
background: #fff none repeat scroll 0 0;
border-top: 8px solid;
padding: 35px;
position: fixed;
text-align: center;
z-index: 9999;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: .4s;
transition: .4s;
visibility: hidden;
max-width: 100%;
}
.ultimate-popup-wrapper-activate {
opacity: 1;
filter: alpha(opacity=100);
visibility: visible;
}
.cross-btn-ppm {
font-size: 20px;
font-weight: 700;
position: absolute;
right: 10px;
text-transform: uppercase;
top: 5px;
cursor: pointer;
z-index: 99;
font-family: arial, sans-serif;
}
.ultimate-popup-inner h2,
.entry-content .ultimate-popup-inner h2,
.entry-summary .ultimate-popup-inner h2,
.page-content .ultimate-popup-inner h2,
.comment-content .ultimate-popup-inner h2 {
font-size: 25px;
margin: 0 0 15px;
word-wrap: normal;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
.ultimate-popup-inner {
font-size: 16px;
}
.ultimate-popup-shortcodes p {
margin-bottom: 15px;
}
.ultimate-popup-shortcodes input[type="text"],
.ultimate-popup-shortcodes input[type="email"] {
border: 1px solid #ddd;
margin-bottom: 10px;
padding: 10px !important;
width: 100% !important;
}
.ultimate-popup-shortcodes {
margin: 30px auto 0;
max-width: 500px;
text-align: left;
}
.ultimate-popup-shortcodes br { display: none }
.ultimate-popup-shortcodes input[type="submit"] {
border: medium none;
border-radius: 7px;
color: #fff;
font-size: 17px;
padding: 15px;
width: 100%;
text-transform: uppercase;
-webkit-transition: .4s;
transition: .4s;
}
.ultimate-popup-shortcodes .gform_wrapper .gform_heading { display: none }
.ultimate-popup-shortcodes .gform_wrapper .gform_footer {
margin: 15px 0 0;
padding: 0;
}
.ultimate-popup-wrapper-hide .lean-overlay,
.ultimate-popup-wrapper-hide .ultimate-popup-wrapper {
display: none !important;
visibility: hidden !important;
}
.ultimate-popup-halfway-scroll-activate .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-2 .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-3 .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-4 .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-8 .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-9 .cross-btn-ppm {
right: 0;
top: 0;
z-index: 99;
border-radius: 0;
}
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-2 .cross-btn-ppm { top: -8px }
.ultimate-popup-theme-id-5.ultimate-popup-halfway-scroll-activate .cross-btn-ppm {
background: #333;
height: 40px;
width: 40px;
line-height: 40px;
border-radius: 50%;
top: 20px;
z-index: 9;
}
.ultimate-popup-theme-id-5.ultimate-popup-halfway-scroll-activate .popup-inner-col-thumb { padding-top: 5px }
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-12 .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-10 .cross-btn-ppm,
.ultimate-popup-halfway-scroll-activate.ultimate-popup-theme-id-6 .cross-btn-ppm {
right: 10px;
top: 5px;
}
.ultimate-popup-theme-id-1 .cross-btn-ppm { right: 10px }
/* Mobile Layout: 320px. */
#media only screen and (max-width: 767px) {
.ultimate-popup-wrapper { overflow: auto }
.ultimate-popup-wrapper .pop-inner-column .popup-inner-col-thumb {
float: none;
margin-bottom: 30px;
margin-top: 0;
padding: 0;
width: auto;
}
.ultimate-popup-wrapper .pop-inner-column .popup-inner-col-cont {
float: none;
padding: 25px;
width: auto;
}
.ultimate-popup-automatic-activate .cross-btn-ppm,
.ultimate-popup-automatic-activate.ultimate-popup-theme-id-2 .cross-btn-ppm,
.ultimate-popup-automatic-activate.ultimate-popup-theme-id-3 .cross-btn-ppm,
.ultimate-popup-automatic-activate.ultimate-popup-theme-id-4 .cross-btn-ppm,
.ultimate-popup-automatic-activate.ultimate-popup-theme-id-8 .cross-btn-ppm,
.ultimate-popup-automatic-activate.ultimate-popup-theme-id-9 .cross-btn-ppm {
right: 0;
top: 0;
z-index: 99;
border-radius: 0;
}
}
<div class="remodal" data-remodal-id="modal"
data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
<form method="post">
<div class="form-group">
<label for="email">Login</label>
<input type="text" class="form-control" required name="email" id="email">
</div>
<div class="form-group">
<label for="pwd">Password</label>
<input type="password" class="form-control" required id="pwd" name="pwd">
</div>
<button type="submit" class="btn btn-default">Enter</button>
</form>
</div>

Two buttons interfering?

I'm working on a webpage but i'm a designer not a developer, I have a problem with my buttons. Here's the code`
<style>
#chat {
position:fixed;
bottom:0;
right:0;
background-color:#000;
width:300px;
padding:10px;
color:white;
display:block;
z-index:99999;
}
#chatbtn {
background:#666;
width:310px;
position:fixed;
bottom:0;
right:0;
z-index:14;
-webkit-border-top-left-radius:5px;
-moz-border-radius-topleft:5px;
border-top-left-radius:5px;
background:#333;
cursor:pointer;
}
#chatbtn h3 {
background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);
background-repeat:no-repeat;
background-position:-5px -574.5px;
margin:0;
font-size:20px;
padding-left:40px;
line-height:2.2;
color:#fff;
font-weight:700;
}
#box {
position:relative;
width:890px;
height:100px;
top:130px;
z-index:14;
margin:0 auto;
}
#box .left_part {
width:810px;
height:100px;
float:left;
}
#box .left_part .top {
width:790px;
height:54px;
margin-left:10px;
}
#box .left_part .bottom {
width:810px;
height:45px;
}
#box .right_part {
width:80px;
height:100px;
float:right;
}
.media_icons {
width:190px;
height:45px;
display:inline-block;
float:left;
text-align:center;
}
.song_titel {
width:510px;
height:45px;
display:inline-block;
float:left;
text-align:center;
}
.social_icons {
width:150px;
height:45px;
display:inline-block;
float:right;
text-align:center;
margin-top:-40px;
}
.twitter a {
background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);
background-repeat:no-repeat;
background-position:-10px -480px;
width:32px;
height:32px;
float:right;
margin:10px 7px 10px 0;
}
.facebook a {
background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);
background-repeat:no-repeat;
background-position:-10px -532px;
width:32px;
height:32px;
float:right;
margin:10px 7px 10px 0;
}
.twitter a:hover {
background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);
background-repeat:no-repeat;
width:32px;
background-position:-10px -480px;
height:32px;
float:right;
margin:10px 9px 10px 0;
}
.facebook a:hover {
background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);
background-repeat:no-repeat;
width:32px;
background-position:-10px -532px;
height:32px;
float:right;
margin:10px 9px 10px 0;
}
#-webkit-keyframes NAME-YOUR-ANIMATION {
0% {
opacity:0;
}
100% {
opacity:1;
}
}
#-moz-keyframes NAME-YOUR-ANIMATION {
0 {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-o-keyframes NAME-YOUR-ANIMATION {
0 {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes NAME-YOUR-ANIMATION {
0 {
opacity: 0;
}
100% {
opacity: 1;
}
}
.black_overlay {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: .8;
opacity: .80;
filter: alpha(opacity=80);
}
.white_content {
display: none;
position: absolute;
bottom: 6%;
right: 0;
padding: 1px;
border: 1px solid black;
background-color: white;
z-index: 1002;
overflow: auto;
}
#tunein {
float: right;
margin: 3px 0px 0 -1px;
margin-top:15px !important;
}
#tunein img {
margin: 3px;
opacity: 0.8;
}
#tunein img:hover {
opacity: 1;
}
.song_titel .current_show, .song_titel .current_song {
font-size: 15px;
color: #FD0E62;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
height: 20px;
line-height: 20px;
}
.song_titel .current_show span, .song_titel .current_song span {
font-size: 12px;
color: white;
line-height: 22px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: normal;
}
</style>
<script>
function show_proto() {
if ($("#chat").css('display') == 'none') {
$("#chat").show();
} else {
$("#chat").hide();
}
}
</script>
<div id="chat" style="z-index:1999999;display:none;">
<iframe id="chat_frame" src="http://www.muzik.gr/chat/index_mini.php" width="470" height="540" name="chat">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
<div style="z-index: 1000000;" id="chatbtn" onclick="show_proto();">
<h3>Chatbox</h3>
</div>
<div>
<style>#contactus{position:fixed;bottom:0;left:0;background-color:#000;width:300px;padding:10px;color:white;display:block;z-index:99999;}#contactusbtn{background:#666;width:310px;position:fixed;bottom:0;left:0;z-index:14;-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-left-radius:5px;background:#333;cursor:pointer;}#contactusbtn h3{background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);background-repeat:no-repeat;background-position:-5px -574.5px;margin:0;font-size:20px;padding-left:40px;line-height:2.2;color:#fff;font-weight:700;}#box{position:relative;width:890px;height:100px;top:130px;z-index:14;margin:0 auto;}#box .right_part{width:810px;height:100px;float:left;}#box .right_part .top{width:790px;height:54px;margin-left:10px;}#box .right_part .bottom{width:810px;height:45px;}#box .right_part{width:80px;height:100px;float:left;}.media_icons{width:190px;height:45px;display:inline-block;float:left;text-align:center;}.song_titel{width:510px;height:45px;display:inline-block;float:left;text-align:center;}.social_icons{width:150px;height:45px;display:inline-block;float:left;text-align:center;margin-top:-40px;}.twitter a{background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);background-repeat:no-repeat;background-position:-10px -480px;width:32px;height:32px;float:left;margin:10px 7px 10px 0;}.facebook a{background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);background-repeat:no-repeat;background-position:-10px -532px;width:32px;height:32px;float:left;margin:10px 7px 10px 0;}.twitter a:hover{background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);background-repeat:no-repeat;width:32px;background-position:-10px -480px;height:32px;float:left;margin:10px 9px 10px 0;}.facebook a:hover{background-image:url(http://www.muzik.gr/wp-content/themes/theme18309/images/spriteme1.png);background-repeat:no-repeat;width:32px;background-position:-10px -532px;height:32px;float:left;margin:10px 9px 10px 0;}#-webkit-keyframes NAME-YOUR-ANIMATION1{0%{opacity:0;}100%{opacity:1;}}#-moz-keyframes NAME-YOUR-ANIMATION1{0 {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-o-keyframes NAME-YOUR-ANIMATION1 {
0 {
opacity: 0;
}
100% {
opacity: 1;
}
}
#keyframes NAME-YOUR-ANIMATION1 {
0 {
opacity: 0;
}
100% {
opacity: 1;
}
}
.black_overlay {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: .8;
opacity: .80;
filter: alpha(opacity=80);
}
.white_content {
display: none;
position: absolute;
bottom: 6%;
left: 0;
padding: 1px;
border: 1px solid black;
background-color: white;
z-index: 1002;
overflow: auto;
}
#tunein {
float: left;
margin: 3px 0px 0 -1px;
margin-top:15px !important;
}
#tunein img {
margin: 3px;
opacity: 0.8;
}
#tunein img:hover{
opacity: 1;
}
.song_titel .current_show, .song_titel .current_song {
font-size: 15px;
color: #FD0E62;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-weight: bold;
height: 20px;
line-height: 20px;
}
.song_titel .current_show span, .song_titel .current_song span {
font-size: 12px;
color: white;
line-height: 22px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-weight: normal;
}
</style>
<script>
function show_proto() {
if ($("#contactus").css('display') == 'none') {
$("#contactus").show();
}
else
{
$("#contactus").hide();
}
}
</script>
<div id="contactus" style="z-index:1000000;display:none;">
<iframe id="contactus_frame" src="http://www.muzik.gr/contactus/contactus.php" width="290" height="600" name="contactus">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
<div style="z-index: 1000000;" id="contactusbtn" onclick="show_proto();">
<h3>Contact Us</h3>
</div>
</div>
`
The Chat box button was working before i added the contact us button. after i added the contact us button it brings the contact us button frame
Thanks for a comment from #TamilSelvan! i could solve my problem!
The problem was that both of the buttons are calling the same js function! show_proto()
So what i did is changed the second function to show_proto1() and it solved my problem!

disable link in parent page while popup

am using the following code to create popup and when popup appears link in parent window are active *how do i make the parent page inactive while popup active
CSS
.popup { position: fixed;background: rgba(255,255,255,.6); left: 25%; top: 25%; width: 50%; height: 350px; margin-top: -75px; background-color: #fff; border: 1px solid #ccc; border-radius: 5px;index: 1;}
.popup .close {position: absolute; right: -5px; top: -5px; text-decoration: none; background-color: #c41e1e; color: #fff; line-height: 1; border-radius: 50px; width: 1em; text-align: center; z-index: 3;}
h3 {margin: 0; padding: 5px 10px; background-color:#8AC007;}
.mask {background-color: #000; z-index: 1; position: absolute; width: 100%; height: 100%; opacity: 0.5;}
HTML
<div class="popup">
<h3>Select Your City</h3>
<a href="#" class="close"
onclick="document.querySelectorAll('.popup')[0].style.display = 'none';
document.querySelectorAll('.mask')[0].style.display = 'none';
return false;">×</a>
<p><h4>Major City's</h4>
</p>
</div>
only popup should be active all the other should be inactive
Here is a jQuery solution.
<style>
.popup { position: fixed;background: rgba(255,255,255,.6); left: 25%; top: 25%; width: 50%; height: 350px; margin-top: -75px; background-color: #fff; border: 1px solid #ccc; border-radius: 5px;index: 1; box-shadow: 2px 2px 10px rgba(0,0,0,0.6); }
.popup .close {position: absolute; right: -5px; top: -5px; text-decoration: none; background-color: #c41e1e; color: #fff; line-height: 1; border-radius: 50px; width: 1em; text-align: center; z-index: 3; cursor: pointer; padding: 2px 3px 3px 3px; }
.popup .close:hover { background-color: #888; }
h3 {margin: 0; padding: 5px 10px; background-color:#8AC007;}
.mask {background-color: #000; z-index: 1; position: absolute; width: 100%; height: 100%; opacity: 0.5;}
#supawrap { display: none; height: 100%; width: 100%; position: absolute; background-color: rgba(0,0,0,0.8); top: 0; left: 0; }
</style>
HTML
<div id="supawrap">
<div class="popup">
<h3>Select Your City</h3>
<div class="close">×</div>
<p><h4>Major City's</h4>
</p>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$('#supawrap').fadeIn('fast');
$('.close').click(function() {
$('.popup').fadeOut('fast');
$('#supawrap').delay(300).fadeOut('fast');
});
});
</script>
#Overlay{
width:100%;
height:100%;
position:fixed;
top:0;
left:0;
opacity:0;
z-index:2; //lower than your pop up
background-color:#222;
background-color:rgba(0,0,0,0.8);
overflow:hidden;
display:none;
}
make display:block; where you give link to pop up

How to Get the first image from the wordpress post resize it (50x50 thumbnail) then display it?

I got this code which address my "Get the 1st image of the post then display it" issue.
<?php echo get_first_image() ?>
My problem is, how to i make it to automatically adjust its size (lets say 50x50) then display it.
What i want to to do is simply get the image from my published post, resize it (50x50 and 250x250) then display it. It will be use in a slider/enhance version of recent post.
thank you very much!
HERES THE CODE of the SLIDER/Recent post
$(".main_image .desc").show();
$(".main_image .block").animate({ opacity: 0.85 }, 1 );
$(".image_thumb ul li:first").addClass('active');
$(".image_thumb ul li").click(function(){
//Set Variables
var imgAlt = $(this).find('img').attr("alt");
var imgTitle = $(this).find('a').attr("href");
var imgDesc = $(this).find('.block').html();
var imgDescHeight = $(".main_image").find('.block').height();
if ($(this).is(".active")) {
return false;
} else {
//Animate the Description
$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
$(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
$(".main_image img").attr({ src: imgTitle , alt: imgAlt});
});
}
//Show active list-item
$(".image_thumb ul li").removeClass('active');
$(this).addClass('active');
return false;
}) .hover(function(){
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
});
$("a.collapse").click(function(){
$(".main_banner .block").slideToggle();
$("a.collapse").toggleClass("show");
});
<div class="main_image">
<img src="banner1.jpg" alt="" />
<div class="desc">
Close Me!
<div class="block">
<h2>Title</h2>
<small>Date</small>
<p>Copy</p>
</div>
</div>
</div>
<div class="image_thumb">
<ul>
<li>
<img src="image\banner1_thumb.jpg" alt="image1234" />
<div class="block">
<h2>Title</h2>
<small>Date</small>
<p>Copy</p>
</div>
</li>
</ul>
</div>
.main_image {
width: 598px;
height: 456px;
float: left;
background: #333;
position: relative;
overflow: hidden;
color: #fff;
}
.main_image h2 {
font-size: 2em;
font-weight: normal;
margin: 0 0 5px;
padding: 10px;
}
.main_image p {
font-size: 1.2em;
line-height: 1.6em;
padding: 10px;
margin: 0;
}
.block small {
font-size: 1em;
padding: 0 0 0 20px;
background: url(iconcalendarKO.gif) no-repeat 0 center;
}
.main_image .block small {margin-left: 10px;}
.main_image .desc{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
display: none;
.main_image .block{
width: 100%;
background: #111;
border-top: 1px solid #000;
}
.main_image a.collapse {
background: url(btn_collapse.gif) no-repeat left top;
height: 27px;
width: 93px;
text-indent: -99999px;
position: absolute;
top: -27px;
right: 20px;
}
.main_image a.show {background-position: left bottom;}image_thumb section CSS
.image_thumb {
float: left;
width: 299px;
background: #f0f0f0;
border-right: 1px solid #fff;
border-top: 1px solid #ccc;
}
.image_thumb img {
border: 1px solid #ccc;
padding: 5px;
background: #fff;
float: left;
}
.image_thumb ul {
margin: 0;
padding: 0;
list-style: none;
}
.image_thumb ul li{
margin: 0;
padding: 12px 10px;
background: #f0f0f0 url(nav_a.gif) repeat-x;
width: 279px;
float: left;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
border-right: 1px solid #ccc;
}
.image_thumb ul li.hover {
.image_thumb {
float: left;
width: 299px;
background: #f0f0f0;
border-right: 1px solid #fff;
border-top: 1px solid #ccc;
}
.image_thumb img {
border: 1px solid #ccc;
padding: 5px;
background: #fff;
float: left;
}
.image_thumb ul {
margin: 0;
padding: 0;
list-style: none;
}
.image_thumb ul li{
margin: 0;
padding: 12px 10px;
background: #f0f0f0 url(nav123_a.gif) repeat-x;
width: 279px;
float: left;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
border-right: 1px solid #ccc;
}
.image_thumb ul li.hover {
background: #ddd;
cursor: pointer;
}
.image_thumb ul li.active {
background: #fff;
cursor: default;
}
html .image_thumb ul li h2 {
font-size: 1.5em;
margin: 5px 0;
padding: 0;
}
.image_thumb ul li .block {
float: left;
margin-left: 10px;
padding: 0;
width: 170px;
}
.image_thumb ul li p{display: none;}
isnt get_the_post_thumbnail enough?
Just call it twice, with different sizes

Categories