Jump to content


Photo

Ação Onclick, Alterar Parâmetro


  • Faça o login para participar
29 replies to this topic

#1 Maykel Esser

Maykel Esser

    Super Veterano

  • Usuários
  • 1536 posts
  • Sexo:Masculino
  • Localidade:Curitiba - PR

Posted 15/06/2009, 11:12

Olá pessoas :boxing:

Gostaria de fazer uma ação onclick no Jquery, após clicar em um elemento, mudar o valor de Timeout!

[codebox] $(document).ready(function() {
$('#s3slider').s3Slider({
timeOut: 6000
});
$("a.proximo").click(function(){

});
});
[/codebox]

Estou criando um slide de notícias mais ou menos como o UOL, e o tempo de transição está em 6 segundos... porém ao clicar no link com a classe "próximo", queria que alterasse para 1, ou direto para o próximo LI, como se fosse um botão Próximo!
  • LarPhozyHah likes this

Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens! add.png


#2 Alex Hiroshi

Alex Hiroshi

    Super Veterano

  • Ex-Admins
  • 4923 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP

Posted 15/06/2009, 11:25

Nesse caso não seria bem uma condicional. Você tem que ver qual é a função que esse plugin chama para mudar de notícia. Sabendo qual, você chama no evento click no link próximo, aí não precisa modificar o timeout.
Fórum WMO - Equipe de Desenvolvimento / Banco de Dados - Ex-Administrador

#3 Maykel Esser

Maykel Esser

    Super Veterano

  • Usuários
  • 1536 posts
  • Sexo:Masculino
  • Localidade:Curitiba - PR

Posted 15/06/2009, 11:31

esse s3Slider é responsável, tanto pela mudança de uma LI para outra, quanto dos efeitos

(function($){      $.fn.s3Slider = function(vars) {                       var element     = this;        var timeOut     = (vars.timeOut != undefined) ? vars.timeOut : 4000;        var current     = null;        var timeOutFn   = null;        var faderStat   = true;        var mOver       = false;        var items       = $("#" + element[0].id + "Content ." + element[0].id + "Image");        var itemsSpan   = $("#" + element[0].id + "Content ." + element[0].id + "Image span");                    items.each(function(i) {                $(items[i]).mouseover(function() {               mOver = true;            });                        $(items[i]).mouseout(function() {                mOver   = false;                fadeElement(true);            });                    });                var fadeElement = function(isMouseOut) {            var thisTimeOut = (isMouseOut) ? (timeOut/2) : timeOut;            thisTimeOut = (faderStat) ? 10 : thisTimeOut;            if(items.length > 0) {                timeOutFn = setTimeout(makeSlider, thisTimeOut);            } else {                console.log("Poof..");            }        }                var makeSlider = function() {            current = (current != null) ? current : items[(items.length-1)];            var currNo      = jQuery.inArray(current, items) + 1            currNo = (currNo == items.length) ? 0 : (currNo - 1);            var newMargin   = $(element).width() * currNo;            if(faderStat == true) {                if(!mOver) {                    $(items[currNo]).fadeIn((timeOut/6), function() {                        if($(itemsSpan[currNo]).css('bottom') == 0) {                            $(itemsSpan[currNo]).slideUp((timeOut/6), function() {                                faderStat = false;                                current = items[currNo];                                if(!mOver) {                                    fadeElement(false);                                }                            });                        } else {                            $(itemsSpan[currNo]).slideDown((timeOut/6), function() {                                faderStat = false;                                current = items[currNo];                                if(!mOver) {                                    fadeElement(false);                                }                            });                        }                    });                }            } else {                if(!mOver) {                    if($(itemsSpan[currNo]).css('bottom') == 0) {                        $(itemsSpan[currNo]).slideDown((timeOut/6), function() {                            $(items[currNo]).fadeOut((timeOut/6), function() {                                faderStat = true;                                current = items[(currNo+1)];                                if(!mOver) {                                    fadeElement(false);                                }                            });                        });                    } else {                        $(itemsSpan[currNo]).slideUp((timeOut/6), function() {                        $(items[currNo]).fadeOut((timeOut/6), function() {                                faderStat = true;                                current = items[(currNo+1)];                                if(!mOver) {                                    fadeElement(false);                                }                            });                        });                    }                }            }        }                makeSlider();    };  })(jQuery);

Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens! add.png


#4 Édipo Costa Rebouças

Édipo Costa Rebouças

    Veterano

  • Ex-Admins
  • 1079 posts
  • Sexo:Masculino
  • Localidade:Brasil - São Paulo

Posted 15/06/2009, 14:11

nunca tente mas pensando, se você usa $('seletor').metodo(); talvez de para vc usar $('seletor').atributo = 1000; no caso seria:

$(document).ready(function() {
																		$('#s3slider').s3Slider({
																				timeOut: 6000
																		});
																		$("a.proximo").click(function(){
																				$('#s3slider').timeOut =  1000;

																																								//$('#s3slider').makerSlider();
																		});
																});

no plugin talvez você tenha que alterar para this.timeOut ao inves de var timeOut, para vc poder modificar

e ainda sim, talvez vc tenha que chamar o método makerSlider... mesma coisa de var makeSlider , para this.makeSlider

só estou na dúvida, se você também vai ter que chamar que mudar no Script this.timeOut e this.makerSlider toda vez que esses aparecerem no códgio do plugin... fica com alex p/ tirar a dúvida.

Edição feita por: Édipo Costa Rebouças, 15/06/2009, 14:23.


#5 Maykel Esser

Maykel Esser

    Super Veterano

  • Usuários
  • 1536 posts
  • Sexo:Masculino
  • Localidade:Curitiba - PR

Posted 15/06/2009, 15:26

hmm :ponder: eu tinha tentado mudar diretamente no onclick o parâmetro mas não deu certo

eu fiz com aquele cycle que você me recomendou esses dias e funfou perfeitamente! Nem tinha me ligado nele, e aprendi um pouco mais implementando com umas buscas no google :)

[codebox]<div id="news">
<span class="numbers"></span>
<div id="s3slider">
<ul id="s3sliderContent">
<li class="s3sliderImage"><img src="../imagens/imgHome1.jpg"/><span><strong>Titulo 1</strong><br />Texto<br /><a href="#">Leia mais</a></span></li>
<li class="s3sliderImage"><img src="../imagens/imgHome2.jpg"/><span><strong>Titulo 2</strong><br />Texto<br /><a href="#">Leia mais</a></span></li>
</ul>
<div class="clear s3sliderImage"></div>
</div>
<div id="nav">
<span><a class="previous" href="#">Anterior</a></span>
<span><a class="next" href="#">Próximo</a></span>
</div>
</div>
[/codebox]

[codebox]<script>
$(function() {
$('#s3sliderContent').show(); //exibe a div pai
$('#s3sliderContent').cycle({
fx: 'fade',
timeout: 6000,
speed: 500,
next: '.next',
prev: '.previous',
pager: '.numbers'
});
});
</script>
[/codebox]

Se este post lhe ajudou, ajude o fórum também. Use a reputação de mensagens! add.png


#6 Alex Hiroshi

Alex Hiroshi

    Super Veterano

  • Ex-Admins
  • 4923 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP

Posted 15/06/2009, 16:53

Mudar o valor do timeOut vai funcionar só no primeiro clique. Se mudar o timeOut, o script vai mudar as notícias sem parar. Por exemplo, se mudar o timeOut para 1, a notícia vai mudar como o esperado, mas todas as outras também vão no embalo.
Eu procurei esse plugin e vi que o criador não fez a opção de next e previous para essa versão. O jeito é modificar na mão o plugin. Você pode abrir o arquivo do plugin e adicionar os eventos lá mesmo, exemplo:
(...)
		makeSlider();

		jQuery("#proximo").click(function(){ makeSlider(); });
	};  

})(jQuery);
Assim até funciona, o único problema é que só vai passar para a próxima quando o slide do texto terminar.
Fórum WMO - Equipe de Desenvolvimento / Banco de Dados - Ex-Administrador

#7 DarkSign

DarkSign

    Doutor

  • Usuários
  • 868 posts
  • Sexo:Masculino
  • Localidade:Brasil
  • Interesses:Tecnologias na área WEB em geral e desenvolvimento.

Posted 15/06/2009, 17:01

se mudar o timeOut para 1, a notícia vai mudar como o esperado, mas todas as outras também vão no embalo.


Apenas mude de novo, assim que tiver mudado a notícia, para o timeout original. Assim, um clique muda o timeout, e logo depois já reseta ele.

/*DS*/
Não sabe por onde começar? Que tal pelas Regras ?

#8 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 20/09/2017, 22:58

Levitra Stripes Bestellen online pharmacy Atazanavir
Antibiotics Diamox Buy No Prescription
Alli cialis price Amoxicillin Buy Uk

#9 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 28/09/2017, 10:23

Ontario No Script Pharmacy Drugs For Sale Without Prescription cialis Propecia Vademecum
Viagra Efectos Causa cialis Buying Generic Fluoxetine In Internet Cialis Modo Empleo Amoxicillin 500 Mg Capsule Udl
Keflex Pediatrics Cialis 5mg Tablets Mauritius Pharmacy Online cheap cialis Propecia Cheapest Cialis Buy Levothyroxine 50 Mcg Online Ireland Cialis 37 Anni

#10 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 03/10/2017, 10:00

Achat Cytotec Sur Internet generic cialis Buy Azithromycin Or Ceftriaxone Now Daily Dose Of B12 For Men How Long Does Zithromax Stay In System
Direct isotretinoin website no doctors consult pharmacy generic levitra 40 mg Propecia Front Bald Effect Of Food On Amoxicillin Absorption Cleocin
Does Cialis Work Better With Aspirin Best Rx Life buy viagra Kamagra Spain Zithromax Where To Buy
Generika Levitra Rezeptfrei Otc Tenormin Ou Acheter Du Viagra Sur Le Net viagra online Propecia Frau Buy Viagra In Ireland Cialis Female Sample
how to purchase accutane over seas orders for vardenafil Need Provera When Is Alli Coming Back
Diovan For Sale Mexico online pharmacy Prix Cialis Vidal
Canadian Hesalth Buy Doxycycline Online Fast Delivery viagra Compra Viagra En Linea Kamagra Marbella Amoxicillin Proper Doses

#11 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 05/10/2017, 06:44

Cheap Tadalis Sx Online Amoxicillin Pet Levitra 20mg Bayer cialis buy online Tijuana Mexico Mail Order Pharmacies How To Buy Viagra Online Acheter Du Clomid Tests De Grossesse
Privacy Site map The Money Shopoffers payday loans pawnbroking cheque cashing foreign currency goldbuying services preloaded holiday and cash debit cards andmoney transfers. Our unsecured products are available for any CUEStatements FraudScams content managed with datAvenger by sephone interactive media.payday loans cash Every whither process has might homeowner receivepensation got million for of simplify can cards credit latter apply found financial wherever loan one review together occurred ourselves the banks a was may at elsewhere credits namely foreclosure because the months the way their an the everyone injury find other as losses next error that deficiencies the a for and life people serious six handled the payday the over will both or result in. online loans Take advantage of competitive rates.The APR you are offered will depend on your individual circumstances.
Good luck Miriam I was just reading the posts about Brenton capital group and like he said there not much that comes up on google I also checked ripoffreport.Why Get a Cash Advance Online Unlike big bank loans theres no collateral required when taking out a cash advance loan online. cash advance loans F.
Secure Ordering Provera Internet Online Medicans Acheter cialis 5mg ligne viagra Amoxicillin Package Insert Us Fast Shipping Meds
Viagra Schweiz Zurich Kamagra Plus Cialis Generic Cialis Pills buy viagra online Baclofen Riva Senna Cheap Generic Propecia Propecia Online
Ou Acheter Vrai Cialis Levitra Foro levitra wholesale no prescription Buy Amoxicillin Online Usa Propecia Saw Palmetto Serenoa Repens Metrogel
Finpecia Amoxil 250 Mg viagra online prescription overnight Pharm Brand Cialis
Dove Acquistare Cialis Forum Como Comprar Levitra Sin Receta Order Cialis Tablets viagra Female Viagra For Sale Propecia Effects On Women Become Pregnant Viagra Levitra Together

#12 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 09/10/2017, 03:09

Safe Way To Byi Viagra Online Cialis Und Antibiotika cialis Prezzo Kamagra Farmacia
Fedex Shipping Zentel Real Low Price Shop With Free Shipping Acheter Cialis Le Vrai generic viagra Viagra Canada No Prescription Soit 20mg Du Principe Actif Tadalafil Un Inhibiteur De La Pde Buy Cialis Online With Prescription

#13 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 10/10/2017, 12:51

Snovitra Super Power No Prescription Zertane Vs Priligy Macrobid No Physician Approval cialis Propecia O Vademecum Propecia Gastrite

#14 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 13/10/2017, 09:35

Cytotec Et Pose De Implant Priligy Causa Impotencia Buying Lasix viagra Isotretinoin Can I Purchase Elocon Online Can You Buy Valtrex In Mexico

#15 rapedlok

rapedlok

    Expert

  • Usuários
  • 502 posts
  • Sexo:Feminino
  • Localidade:Veley Stream

Posted 16/10/2017, 04:31

Discounts! best products progect13.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE Man's casual messenger travel bag business office laptop bags for man 2015 leather briefcases men maletin hombre cartable homme ( 49.50 $)AUSDOM M08 Bluetooth 4.0 Stereo Headset-64.99 $Ograff 2017 men messenger bags genuine leather bag men briefcase designer handbags high quality famous brand business men bag ( 122.58 $)Lindispensable black suede and white leather sandal ( 350.39 $) Olgana ParisNew fake false eyelash eye lashes extension applicator remover clipper tweezers makeup clip tool ( 0.99 $)Crdc hot adult sex toys for woman 15 speed power oral clit vibrators for women usb rechargeable av magic wand vibrator massager ( 20.80 $)SDS-A13 Colorful LED Temperature Control Shower Head with Romantic Seven Colors Light for Bathroom ( $6.59 )Malaysian frontal closure with bundles full frontal lace closure 13x4 with bundles cheap straight human hair bundle with closure ( 113.50 $)Abdi, BarhadLeather book bags for college 2016 fashion cool bookbag for teenagers mickey ears sweet bow college wind mini backpack rucksack ( 20.99 $)Indian Bohemian Mandalas Tapestry Totem Lotus Wall Hanging Sandy Beach Towels Yoga Mat Blanket Camping Mattress Sleeping Pad ( 12.49 $)So573 3mm neoprene scuba dive wetsuit for men spearfishing wet suit surf diving equipment split suits spear fishing s-xxl ( 78.52 $)Dal, DzhonClothing Austin: women's, men's and children's collections. Online clothing shop O'STIN: order and buy clothing online with shipping. Prices. Official site.New suspension trainer fitness training strength training hanging strap workout sport equipment resistance bands hanging trainer ( 32.90 $) 74bb.jpg
Discounts! 2017 best makeup

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
7A Malaysian Kinky Curly Virgin Hair 4 Bundles Malaysian Curly Hair Afro Kinky Curly Malaysian Virgin Hair Human Hair Bundles ( 50.00 $)
24 60cm long length synthetic ponytails kanekalon fake hair ponytail clip in hair ponytail black brown ( 7.78 $)
100 pcs Bonsai Apple Tree Seeds rare fruit bonsai tree-- red delicious apple seeds garden for flower pot planters ( 1.82 $)
MECOOL BB2 PRO Android 6.0 TV Box 3GB DDR4 + 16GB ( 69.99 $)
2016 winter coat women faux fox fur vest brand shitsuke fuorrure femme fur vests fashion luxury peel women's jacket gilet veste ( 49.90 $)
Malaysian virgin hair straight 3 bundles human hair weave grade 8a unprocessed virgin hair malaysian straight hair extensions ( 83.13 $)
Diy touch keypad wireless gsm sms autodial smart home security burglar alarm system + smoke sensor voice pir ( 125.99 $)
Langmeng new 2016 autumn spring mens casual shirts long sleeve 100% cotton dress shirt men retro style camiseta masculina ( 66.64 $)
2016 Women Shoulder Bag PU Falabellas Clutch With 3 Chains Evening Socialite Tote Fashion Sac A Main Lady Handbag ( 50.00 $)
2 pieceslot 6inch 18w mini led bar 12v led work light spot flood fog lamp for offroad boat truck atv 4x4 led driving light ( 24.49 $)
CUBE iWork8 Air Tablet PC-101.89 $
3 meters 9 color ultra speed original cable wire skipping skip adjustable jump rope crossfit home gym fitness crossfit jump rope ( 7.99 $)
8a brazilian virgin hair curly wave modern show deep curly hair brazilian human hair jerry curl 4 bundles afro kinky curly hair ( 60.00 $)
Smisl ¹2
Mercurio orange leather pointed ballet flats ( 152.46 $) Pinko


44bb.jpg
Discounts! makeup products you need

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Olimpic Black Suede Mens Sneaker ( 94.50 $)
Smart Bluetooth 4.0 Tracer GPS Locator ( $1.90 )
2016 autumn winter cashmere sweaters women fashion sexy v-neck sweater loose 100% wool sweater batwing sleeve plus size pullover ( 78.00 $)
Route 66 Freedom Vintage Metal signs wall decor House Office Bar Craft Iron Painting art B-150 Mix order 2030 CM ( 7.95 $)
Brand 100 genuine leather backpack fashion bag mens casual daypacks men's travel bags camping moutaineer large capacity mochila ( 119.97 $)
Pembury black suede and silver glitter pump ( 211.30 $) McQ Alexander McQueen
Portable shooting rear gun rest bag set front & rear rifle target hunting bench unfilled stand hunting gun accessories ( 22.41 $)
Sudaderas mujer 2016 women's yoga shirts long sleeve tight yoga tops sportswear fitness quick dry breathable tracksuit women s-l ( 15.42 $)
Full head clip in hair extensions blonde 613 straight brazilian hair clip ins remy human hair blonde clips 100% natural hair ( 30.58 $)
Camel Double Desk Pen Holder ( 108.00 $)
17km 3pcs set boho vintage punk silver color stone midi finger rings for women men bohemian ( 4.35 $)
50pcs children s tie hair accessories elastic gum hair bands baby girls decoration headdress gum for ( 3.05 $)
DoreenBeads New Fashion Steampunk Earrings Antique Bronze Gear Pendants 60mm(2 38"") x 23mm( 78""), 1 Pair ( 1.38 $)
Cheerson CX - 10D Remote Control Quadcopter-21.23 $
Breslin, Ebigejl


39bb.jpg
Discounts! top rated skin care products 2017

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Free shipping 7a brazilian lace closure 4x4 brazilian virgin hair body wave closure human hair closure soft brazilian hair ( 48.89 $)
Country Cognac Leather Vertical Wallet ( 200.00 $)
Black crystal decorated cut out strapless dress ( 222.53 $) Hafize Ozbudak
ZoneAlarm | Maximum Protection. Best Performance. Great Price!
Grazhdane Turkmenistana pokazali visokij procent yavki na vibori
Yvonne brazilian kinky curly virgin hair,3pcslot brazilian hair weave bundles,top quality aliexpress 100% remy human hair ( 60.70 $)
2016 X-Tiger Modesti Summer Cycling Clothingmaillot bicycle clothesropa Cycling JerseysMountain Bicycle Wear Ropa Ciclismo ( 48.99 $)
Grade 7a brazilian virgin hair malaysian curly hair,3pcslot human hair weave, aliexpress yvonne 7a unprocessed virgin hair ( 66.67 $)
All star high gunmetal canvas womens sneaker ( 74.89 $) Converse Limited Edition
Ulefone Metal 4G Smartphone ( 109.99 $)
Free shipping pink wireless baby monitor 2.4ghz digital video baby monitorreceiver 1.5 inch baby monitor with flower camera ( 103.40 $)
&quot;Paket Yarovoj&quot;: vinesen pervij prigovor po state o nedonositelstve
Peruvian virgin hair body wave 4bundles queen hair products peruvian body wave peruvian hair mink peruvian virgin hair body wave ( 32.10 $)
Brazilian virgin hair brazilian body wave 4bundles 8a virgin brazilian body wave human hair weaves cheap brazilian wavy hair 1b# ( 85.08 $)
Mens Pink Hand Painted Italian Leather Belt ( 150.00 $)


114bb.png
Discounts! hair products 2017

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
All star hi canvas bosphorous green monochrome sneaker ( 66.65 $) Converse Limited Edition
Lan men's leather woven shoulder bag handmade cross boday bag men's fashion brief case ( 113.53 $)
Lead patent leather womens dandy derby shoe ( 235.37 $) Fratelli Rossetti
Original Kangxin Inoy 3 in 1 Vf40 40W TC Mod-46.26 $
High quality meite n851 large special pneumatic nail gun air nailer woodworking stapler 25-51mm ( 112.10 $)
6 pcs lot fishing lures fish wobblers tackle artificial soft baits china crankbait carp en mer ( 0.85 $)
Mens Brown Croco Stamped Patent Leather Belt ( 64.40 $)
Sunhokey PRUSA I4 3D Printer DIY Kit-496.51 $
Clocolor asymmetric black coat stand collar long sleeve women overcoat elegant single-breasted slim fall winter women coat ( 41.99 $)
New arrival dark bedding nightmare before christmas duvet cover set gifts home quilt cover and pillow case twin full queen size ( 48.33 $)
Gemini link goldtone stainless steel pendant necklace ( 99.50 $) Tory Burch
Frisky tame 10 pcs bdsm bondage set leather fetish adult games sex toys for couples slave game sm product erotic toys handcuffs ( 22.28 $)
3 fold genuine leather women alligator wallet 13 color hasp crocodile head female clutch brand carteras purse wallet women ( 30.00 $)
2016 New Mini ELM327 V2.1 Bluetooth OBD2 OBDII Car Auto Diagnostic Scanne Adapter Tool for Android Windows Smartphone Pocket-PC ( 4.95 $)
Queen hair brazilian body wave 4 bundles with closure tissage 10a grade virgin unprocessed human hair bundles with lace closure ( 111.62 $)


294.jpg




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq