problema conditia if else
Forum gratuit: forum de suport al utilizatorilor :: Forum de suport :: Probleme legate de un script (cod) :: Arhiva scripturi/coduri
Pagina 1 din 2 • Distribuiţi
Pagina 1 din 2 • 1, 2
problema conditia if else
- Cod:
$(function(){
if ($("a#toggle_sidebar").length > 0) {
$('#toggle_sidebar').click(function() {
$('#dw_right').show();
$('#content-container div#container').css('width','83%');
});
}
else {
$('#toggle_sidebar').click(function() {
$('#dw_right').hide();
$('#content-container div#container').css('width','100%');
});
}
});
ce am gresit de nu merge ?
Ultima editare efectuata de catre VeteraNNN in Sam Feb 02, 2013 5:53 pm, editata de 1 ori
VeteraNNN- Membru activ
- Mesaje : 484
Varsta : 30
Localizare : Undeva in spatele tau !!
Data înscrierii : 28/10/2012
Mulțumiri : 0
Re: problema conditia if else
Pai ne poti spune ce se intampla cand ruleaza? Posteaza un link unde ai lucrat.
Incearca totusi..
Incearca totusi..
- Cod:
$(function () {
if ($("a#toggle_sidebar").length > 0) {
$('#toggle_sidebar').click(function () {
if(!$(this).is(':visible'))
{
$('#dw_right').show();
$('#content-container div#container').css('width', '83%');
}
else
{
$('#dw_right').hide();
$('#content-container div#container').css('width', '100%');
}
});
}
});
Re: problema conditia if else
ai un if dupa inca un if .. trb sa folosesti conditia if{ bla bla bla } else if {bla bla bla} else{ bla bla bla} nu merge asa bine cu doi de if
Re: problema conditia if else
ma poti ajuta .razvan ?
VeteraNNN- Membru activ
- Mesaje : 484
Varsta : 30
Localizare : Undeva in spatele tau !!
Data înscrierii : 28/10/2012
Mulțumiri : 0
Re: problema conditia if else
Ai incercat macar codul dat de mine?
Re: problema conditia if else
scuze omu acuma il incerc si iti dau raspunsul
PS: Omu functioneaza dar nu il poti face sa aiba si functia .toggle() ?
PS: Omu functioneaza dar nu il poti face sa aiba si functia .toggle() ?
VeteraNNN- Membru activ
- Mesaje : 484
Varsta : 30
Localizare : Undeva in spatele tau !!
Data înscrierii : 28/10/2012
Mulțumiri : 0
Re: problema conditia if else
Toggle unde anume?
VeteraNNN- Membru activ
- Mesaje : 484
Varsta : 30
Localizare : Undeva in spatele tau !!
Data înscrierii : 28/10/2012
Mulțumiri : 0
Re: problema conditia if else
Deci tu vrei ca atunci cand dai click pe "X" sa dispara widgeturile si sa se lungeasca categoria? Fara partea HTML este ceva mai complicat, dar incearca totusi:
- Cod:
$(function () {
$('#toggle_sidebar').addclass('toggle_sidebar2');
$('.toggle_sidebar2').click(function () {
$('#dw_right').hide();
$('#content-container div#container').css('width', '100%');
});
$('#toggle_sidebar').click(function () {
$('#dw_right').show();
$('#content-container div#container').css('width', '83%');
});
});
Re: problema conditia if else
Nu merge
Alte idei nu mai ai ?
Alte idei nu mai ai ?
VeteraNNN- Membru activ
- Mesaje : 484
Varsta : 30
Localizare : Undeva in spatele tau !!
Data înscrierii : 28/10/2012
Mulțumiri : 0
Re: problema conditia if else
HTML:
- Cod:
<a id="toggle_sidebar">X</a>
<div id="dw_right">Continutul tau aici</div>
- Cod:
$(function () {
$('#toggle_sidebar').addclass('toggle_sidebar2');
$('a.toggle_sidebar2').click(function () {
$('#dw_right').hide();
$('#content-container div#container').css('width', '100%');
});
$('#toggle_sidebar').click(function () {
$('#dw_right').show();
$('#content-container div#container').css('width', '83%');
});
});
Re: problema conditia if else
uite codul folosit de mine
- Cod:
$(function(e) {
$('#content-container div#container').css('width','83%');
$('#content-container div#container').after('<a href="#" id="toggle_sidebar" title="" data-closed="«" data-open="×" onclick="#">×</a><div id="dw_right"><ul class="dwtheme">
<li>phpBB3 - Theme</li>
<li id="id-1"> <a href="/t14-carbon-blue" id="carbon_blue">1. Carbon Blue</a><span id="views"></span></li>
<li id="id-2"> <a href="/t34-overlay-bluberry">2. Overlay Bluberry</a><span id="views"></span></li>
<li id="id-3"> <a href="/t31-uniform">3. Uniform</a><span id="views"></span></li>
<li id="id-4"> <a href="/t5-ip-board-default">4. IP. Board Default</a><span id="views"></span></li>
<li id="id-5"> <a href="/t21-es-blue-v1">5. ES Blue v1</a><span id="views"></span></li>
<li id="id-6"> <a href="/t96-photoshop-glosy">6. PhotoShop Glosy</a><span id="views"></span></li>
<li id="id-7"> <a href="/t50-uniform-blue">7. Uniform Blue</a><span id="views"></span></li>
<li id="id-8"> <a href="/t4-blue-sensivity">8. Blue Sensivity</a><span id="views"></span></li>
<li id="id-8"> <a href="/t51-proglass">9. proglass</a><span id="views"></span></li>
<li id="id-10"> <a href="/t133-kevin-cods-v1#406">10. Kevin-Cods v1</a><span id="views"></span></li>
</ul>
<br />
<ul class="dwtheme">
<li>punBB - Theme</li>
<li id="id-1"> <a href="/t16-blue-white">1. Blue White</a><span id="views"></span></li>
<li id="id-10"> <a href="/t89-anonymous">2. Anonymous</a><span id="views"></span></li>
</ul>
<br />
<ul class="dwtheme">
<li>Premium - Theme</li>
<li id="id-1"> <a href="/t102-premium-final-supernova-blue">1. Supernova Blue [Price]</a><span id="views"></span></li>
<li id="id-10"> <a href="/t75-premium-navia">2. Navia [Free]</a><span id="views"></span></li>
</ul>
<br />
<ul class="dwtheme">
<li>Last Members Online</li>
<li id="latest_online_members"></li>
</ul>
<br />
<ul class="dwtheme">
<li>Online Staff</li>
<li id="staff"><img src="http://ipbforumskins.com/skindemo/public/style_images/wireless/post_offline.png" alt="" class="post_online" data-tooltip="Offline" id="anonymous_element_5"> <i>Not new online staff</i></li>
</ul>
<br />
<ul class="dwtheme">
<li>Statistics</li>
<li id="id-1">Total Topic: <span id="dw_topic"></span></li>
<li id="id-2">Total Post: <span id="dw_post"></span></li>
<li id="id-3">Total User: <span id="dw_user"></span></li>
<li id="id-10">Most Online: <span id="dw_online"></span></li>
</ul>
<style>.dwtheme li:nth-child(1) {
background: url("http://i48.servimg.com/u/f48/17/48/49/15/highli19.png") repeat-x scroll 0 0 #EEE;
border: 1px solid #D8D8D8;
clear: both;
margin-left: -6px;
margin-right: -6px;
padding: 5px 8px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
position: relative;
top: -6px;
}
.dwtheme {
background: whiteSmoke;
border: 1px solid #DDD;
width: 190px;
padding: 5px;
margin-left: 10px;
margin-top: 16px;
}
#id-1, #id-2, #id-3, #id-4, #id-5, #id-6, #id-7, #id-8 {
padding: 0 0 6px;
border-bottom: 1px solid #CCC;
margin-bottom: 5px;
}
#id-9, #id-10 {
padding: 0 0;
margin-bottom: 2px;
}
.dwtheme #views {
float: right;
}
div#dw_right {
display: block;
}
#dw_topic, #dw_post, #dw_user, #dw_online {
padding-left: 5px;
}
#latest_online_members a span {
display: none;
}
#latest_online_members a img {
width: 30px;
margin-right: 7px;
height: 30px;
background: white;
padding: 1px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.13);
margin-bottom: 5px;
}
#latest_online_members a span {
position: absolute;
margin-left: -45px;
margin-top: -20px;
background: #EEE;
padding: 2px 5px;
border: 1px solid;
}
#latest_online_members a:hover #latest_online_members a span {
display: block;
}
#latest_online_members {
margin-left: 14px;
}
#toggle_sidebar {
position: absolute;
right: 37px;
z-index: 8000;
background: #1988C7;
padding: 3px 7px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
color: white;
opacity: 0.1;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
}
#toggle_sidebar:hover {
opacity: 1;
}
</style></div>');
});
$(function() {
$('#variables strong:eq(0)').clone().appendTo('#dw_topic');
$('#variables strong:eq(1)').clone().appendTo('#dw_post');
$('#variables strong:eq(2)').clone().appendTo('#dw_user');
$('#variables strong:eq(3)').clone().appendTo('#dw_online');
$('#latest_online_members').load('/memberlist #memberlist .avatar-mini a:lt(8)');
});
$(function () {
$('#toggle_sidebar').addclass('toggle_sidebar2');
$('a.toggle_sidebar2').click(function () {
$('#dw_right').hide();
$('#content-container div#container').css('width', '100%');
});
$('#toggle_sidebar').click(function () {
$('#dw_right').show();
$('#content-container div#container').css('width', '83%');
});
});
VeteraNNN- Membru activ
- Mesaje : 484
Varsta : 30
Localizare : Undeva in spatele tau !!
Data înscrierii : 28/10/2012
Mulțumiri : 0
Pagina 1 din 2 • 1, 2
Subiecte similare
» Problema cod
» problema pagina de start problema grup problema avatar
» Problema CSS
» Problema
» Problema
» problema pagina de start problema grup problema avatar
» Problema CSS
» Problema
» Problema
Forum gratuit: forum de suport al utilizatorilor :: Forum de suport :: Probleme legate de un script (cod) :: Arhiva scripturi/coduri
Pagina 1 din 2
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum