Un mic ajutor

Discutii legate de AJAX, jQuery, MooTools, Prototype, Dojo, Yahoo! UI Library,script.aculo.us, ExtJS,AngularJS, Backbone.js, Ember.js, KnockoutJS

Moderator: Moderatori

stafuk3nt
New Member
Mesaje: 2
Membru din: Sâm Ian 04, 2014 2:37 pm

Un mic ajutor

Mesajde stafuk3nt » Sâm Ian 04, 2014 3:16 pm

Salut,

Dupa atatea cautari pe google,am dat de voi,problema e ca as avea nevoe putin
de ajutor din partea voastra,am un site lavalair,iam facut versiunea web(putin inspirata dupa alta versiune) dar nu imi iasa ceva anume,cand dau click pe poza nu imi arata poza cum as vrea eu,atasez o imagine ca sa o vedeti cum as vrea sa fie..
http://stafu-k3nt.biz/wap/poze/stafu-k3 ... 841328.jpg



badtiger
Senior Member
Mesaje: 598
Membru din: Vin Noi 03, 2006 7:54 pm
Contact:

Re: Un mic ajutor

Mesajde badtiger » Sâm Ian 04, 2014 8:30 pm

Cu tot respectul,
Scrie-ne versiunea in romana, cu "." si ",", iar noi o sa incercam sa te ajutam

stafuk3nt
New Member
Mesaje: 2
Membru din: Sâm Ian 04, 2014 2:37 pm

Re: Un mic ajutor

Mesajde stafuk3nt » Sâm Ian 04, 2014 11:12 pm

AM folosit asa ceva in .js


$(function(){

$('body').on('click', 'a.shady-window', function() {

//Getting the variable's value from a link
var Box = '#shady-box';
var id = $(this).attr('img');

// Adauga masca si fereastra
$('body').append('<div id="mask"></div>');

var html = '<div style="padding:10px;"><img src="images/ajax-loader.gif"> Te rug&#x103;m, a&#x15F;teapt&#x103; ...</div';

$.post('inc/galerie.php', {a: 'check', id: id}, function(data){

var decod = $.parseJSON(data);

if(decod.status == 'ok'){

html = '<a href="javascript:void(0)" class="close"><img src="images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a> \
<div style="padding:10px; position:absolute; top:15px; left:5px;"> \
<ul class="clp" id="' + id + '"> \
<li id="vot">Voteaz&#x103;<span class="sright"><img src="images/gup.png"> <span id="pvup">' + decod.up + '</span> <img src="images/gdown.png"> <span id="pvdown">' + decod.down + '</span></span></li> \
<li id="wcom">Comenteaz&#x103;</li> \
<li id="coms">Comentarii <span class="sright">' + decod.coms + '</span></li> \
<li id="info">Informa&#x21B;ii</li> \
<li id="down">Descarc&#x103;</li> \
</ul> \
</div>';
html += '<div id="popinfos" style="display:none; border:1px solid #308da2; position:absolute; font-size:12px; right:15px; top:15px; min-height:50px; padding:10px; margin:10px 0 0 0; width:280px; background-color:white; opacity:0.8; filter:alpha(opacity=80);">Uploadata de <a href="profil-' + decod.uidname + '.html" target="_blank">' + decod.uidname + '</a> <br /> Album: <a href="albumfoto-' + decod.album + '-' + decod.uidname + '.html">' + decod.albumn + '</a> <br /> Descarcari: <b>' + decod.downds + '</b> <br /> Vizualizari: <b>' + decod.views + '</b></div>';

if(decod.prev != null){
html += '<a href="#' + decod.prev + '" img="' + decod.prev + '" class="shady-window"><div class="bnepr" style="position:absolute; top:45%; left:20px;">Anterioara</div></a>';
}

if(decod.next != null){
html += '<a href="#' + decod.next + '" img="' + decod.next + '" class="shady-window"><div class="bnepr" style="position:absolute; top:45%; right:20px;">Urm&#x103;toarea</div></a>';
}

$(Box).html(html).append('<div style="width:100%; height:100%; overflow:auto;"><center><img src="' + decod.url + '" style="max-height:480px;"></center></div>');

} else if(decod.status == 'ne') {
alert('Aceasta fotografie nu exista!');
$('#mask, #shady-box').remove();
return false;

} else if(decod.status == 'nl') {
alert('Nu esti logat!');
$('#mask, #shady-box').remove();
return false;
}

});

$('body').append('<div id="shady-box" class="shady-popup">' + html + '</div>');

//Fade in the Popup
$(Box).fadeIn(300);

//Set the center alignment padding + border see css style
var popMargTop = ($(Box).height() + 24) / 2;
var popMargLeft = ($(Box).width() + 24) / 2;

$(Box).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});

$('#mask').fadeIn(300);

return false;

});

// When clicking on the button close or the mask layer the popup closed
$(document).on('click', 'a.close, #mask', function() {

$('#mask, .shady-popup').fadeOut(300 , function() {
$('#mask, #shady-box').remove();
});

});

// Informatii
$(document).on('click', '#shady-box .clp #wcom', function() {

var wc = $('#writecom');
if(wc.css('display') == undefined){

if($('#popinfos').css('display') != 'hidden'){
$('#popinfos').hide();
}

$('.shady-popup').append('<div id="writecom" style="border:1px solid #308da2; position:absolute; font-size:12px; right:15px; top:15px; min-height:50px; padding:10px; margin:10px 0 0 0; width:280px; background-color:white; opacity:0.8; filter:alpha(opacity=80);"> \
<textarea id="ptextc" style="width:270px;" placeholder="Scrie comentariul t&#x103;u"></textarea><br /> \
<a href="javascript:void(0)" class="button" id="trimite">Scrie</a> \
</div>');
}else{
wc.remove();
}

});

// Votaeza
$(document).on('click', '#shady-box .clp #vot', function() {

var vot = $('.addvotp');

if(vot.css('display') == undefined){
$(this).after('<li class="addvotp" id="1"><img src="images/gup.png"> Imi place</li> \
<li class="addvotp" id="2"><img src="images/gdown.png"> Nu mi place</li>');
}else{
vot.remove();
}

});

// Trimite votul
$(document).on('click', '#shady-box .clp .addvotp', function() {

$('.addvotp').remove();
$('.clp #vot').after('<span id="loadvot"><img src="images/ajax-loader.gif"> a&#x15F;teapt&#x103; ...</span>');
var vot = $(this).attr('id');

$.post('inc/wall-post.php', {a: 'addvotp', id: $('.clp').attr('id'), vot: vot}, function(data){

$('#loadvot').remove();

if(data != ''){
alert(data);
return false;
}

switch(vot){

case '1':
var n = $('#pvup');
var pi = parseInt(n.text()) + 1;
n.text(pi);
break;

case '2':
var n = $('#pvdown');
var pi = parseInt(n.text()) + 1;
n.text(pi);
break;

}


});
});

// Comentarii
$(document).on('click', '#shady-box .clp #coms', function() {

var comsdiv = $('#shady-box #com');
if(comsdiv.css('display') == undefined){
$('.shady-popup').append('<div id="com" style="position:absolute; overflow:auto; bottom:5px; height:200px; width:480px; padding:0 10px; background-color:white; opacity:0.9; filter:alpha(opacity=90);"></div>');
$('#shady-box #com').html('<div style="padding:10px;"><img src="images/ajax-loader.gif"> Te rug&#x103;m, a&#x15F;teapt&#x103; ...</div>').load('inc/coms.php', {a: 'poza', id: $('.clp').attr('id')});
}else{
comsdiv.remove();
}

});

// Scrie comentariu
$(document).on('click', '#shady-box .clp #info', function() {

var comsdiv = $('#popinfos');
if(comsdiv.css('display') == 'none'){

// Sterge toate elementele vizibile
$('#writecom').remove();

comsdiv.show();
}else{
comsdiv.hide();
}

});

// Trimite comentariul scris
$(document).on('click', '#shady-box #writecom #trimite', function() {

var d = $('#writecom');
var text = $('#ptextc').val();

if(text == ''){
alert('Compleaz&#x103; comentariul t&#x103;u!');
return false;
}

d.html('<img src="images/ajax-loader.gif"> Te rug&#x103;m, a&#x15F;teapt&#x103; ...');
$.post('inc/wall-post.php', {a: 'compoza', id: $('.clp').attr('id'), text: text}, function(data){

if(data != ''){
alert(data);
d.remove();
return false;
}

d.html('<i>Comentariul a fost scris!</i>');

setTimeout(function(){
d.remove();
},4000);

if($('#shady-box #com').css('display') != undefined){
$('#shady-box #com').html('<img src="images/ajax-loader.gif"> Te rug&#x103;m, a&#x15F;teapt&#x103; ...').load('inc/coms.php', {a: 'poza', id: $('.clp').attr('id')});
}

});

});

// Mai multe comentarii
$(document).on('click', '#shady-box .mcomp', function(){

var t = $(this);
t.remove();

$.post('inc/coms.php', {a: 'poza', id: $('.clp').attr('id'), pg: t.attr('start')}, function(data){
$('#shady-box #com').append(data);
});

});

// Download
$(document).on('click', '#shady-box .clp #down', function(){

window.open('../descarca-poza/' + $('.clp').attr('id'), '_blank');

});

// Mai multe comentarii
$(document).on('click', '#shady-box .llinks .sop', function(){

var id = $(this).attr('id');
var cr = $('.cl').attr('id');

if(id == cr){
$('.cl').remove();
return false;
}

var arr = $(this).attr('o').split('|');

str = '';

$.each(arr, function(key, value){

switch(value)
{

case 't':
str += '<li class="mul" id="' + id + '">Mul&#x21B;ume&#x15F;te-i</li>';
break;

case 'r':
str += '<li class="rap" id="' + id + '">Raporteaz&#x103;</li>';
break;

case 'd':
str += '<li class="del" id="' + id + '">&#x218;tergere</li>';
break;

}

});

$('.cl').remove();
$(this).after('<ul class="cl" id="' + id + '" style="font-size:11px; margin-top:15px;">' + str + '</ul>');

});

// Optiuni postare poza
$(document).on('click', '#shady-box .cl li', function(){

var t = $(this);
var what = t.attr('class');
var id = t.attr('id');

switch(what){

case 'rap':

$.post('inc/wall-post.php', {a: 'rappozc', id: id}, function(data){

if(data != ''){
alert(data);
}else{
alert('Postarea a fost raportat&#x103;!');
}

});

break;

case 'mul':

$.post('inc/wall-post.php', {a: 'multpozc', id: id}, function(data){

if(data != ''){
alert(data);
}else{
t.remove();
alert('Ai mul&#x21B;umit pentru aceast&#x103; postare!');
}

});

break;

case 'del':

$.post('inc/wall-post.php', {a: 'relcompoz', id: id}, function(data){
if(data != ''){
alert(data);
}else{
$('#poc' + id).fadeOut(200);
}

});

break;

}

$('.cl').remove();

});

});
Si asta in link-ul fin galerie.php

echo "<div id=\"albparr\" style=\"margin-top:10px; min-height:200px;\"><a href=\"javascript:void(0)84802\" img=\"84802\" class=\"shady-window\"><div class=\"galimga\" title=\"shady - 23 ani / 2 poze\" style=\"float:left; background:url(link-ul pozei) no-repeat; width:70px; height:70px; background-size:70px 70px;\"></div></a>";
Scriptul este lavalair ca sa stiti ...

Avatar utilizator
mandix
Average Member
Mesaje: 142
Membru din: Dum Apr 01, 2012 2:04 am
Localitate: Santana, Arad
Contact:

Re: Un mic ajutor

Mesajde mandix » Mie Ian 08, 2014 2:53 pm

http://www.fancybox.net/, ii super customizabil. Faci un div, il fixezi, pui continut si tot ii la fix. In caz ca nu te descurci i-a caption-ul si modifica-i dimensiunile culori, pune ce vrei in el si schimba-i pozitia unde vrei. Codul ce l-ai pus nu o sa se uite nimeni peste el. Nu se chinuie nimeni sa faca un slideshow sau un lightbox daca sunt gata facute si pe gratis cate vrei, iar cu mici adaugaturi iese exact cum iti doresti. Succes!


Înapoi la “Librarii Javascript”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 3 vizitatori