Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Dae galera, existem esses alerts aqui:
http://amatyr4n.com/codecanyon/fallr/
Segue o código de alguns:
<script>
$(window).load(function() {
$('#alert').click(function() {
$.fallr({
content : "<h1>Testando acentuação</h1><p>Hello from fallr!</p>",
position : 'center',
autoclose : 3000
});
});
$('#confirm').click(function() {
var clicked = function(){
alert('congrats, you\'ve deleted internet');
$.fallr('hide');
};
$.fallr('show', {
buttons : {
button1 : {text: 'Yes', danger: true, onclick: clicked},
button2 : {text: 'Cancel', onclick: function(){$.fallr('hide')}}
},
content : '<p>Are you sure you want to delete internet?</p>',
icon : 'error'
});
});
$('#prompt').click(function() {
var clicked = function(){
var yourname = $(this).children('form').children('#yourname').val();
alert('Hello, ' + yourname);
$.fallr('hide');
};
$.fallr('show', {
buttons : {
button1 : {text: 'Submit', onclick: clicked},
button2 : {text: 'Cancel'}
},
content : '<p>Give me your name</p><form><input type="text" id="yourname" /'+'></form>',
icon : 'form'
});
});
$('#form').click(function(){
var login = function(){
var user = $(this).children('form').children('input[type="text"]').val();
var pass = $(this).children('form').children('input[type="password"]').val();
if(user.length < 1 || pass.length < 1){
alert('Invalid!\nPlease fill all required forms');
} else {
alert('username: '+user+'\npassword: '+pass);
$.fallr('hide');
}
}
$.fallr('show', {
icon : 'secure',
width : '320px',
content : '<h4>Sign in</h4>'
+ '<form>'
+ '<input placeholder="Username" type="text"/'+'>'
+ '<input placeholder="Password" type="password"/'+'>'
+ '</form>',
buttons : {
button1 : {text: 'Submit', onclick: login},
button4 : {text: 'Cancel'}
}
});
});
$('#no-overlay').click(function(){
$.fallr('show', {
content : '<p>Yay, no overlay!</p>',
icon : 'info',
useOverlay : false
});
});
});
</script>
O que eu queria fazer, é substituir o alert tradicional que eu uso para cadastrar/alertar algo por esse em jquery.
O que uso atualmente é nesse estilo:
<script> alert('Este e-mail já está sendo utilizado.');</script>
Como eu faria para exibir esse alert sem clicar em nada?
Creio que a parte do código é essa:
$('#alert').click(function() {
$.fallr({
content : "<h1>Testando acentuação</h1><p>Hello from fallr!</p>",
position : 'center',
autoclose : 3000
});
});
Talvez substituir o click por algo, mas o que?
Muito obrigado!
Carregando comentários...