小编Mat*_*att的帖子

jQuery - 在显示滑动面板时动画显示绝对定位div的"左"位置

我在屏幕左侧有一个隐藏的面板,当屏幕左侧的"标签"点击时,它会滑入视图.我需要面板滑过现有页面内容的顶部,我需要选项卡随之移动.所以两者都绝对定位于CSS.一切都很好,除了我需要标签(以及标签容器)在面板显示时向左移动,所以它似乎粘在面板的右侧.使用浮动时它相对简单,但当然这会影响现有内容的布局,因此绝对定位.我已经尝试动画了面板容器的左侧位置(请参阅记录的jquery函数),但我无法使其工作.

这是我已更改的原始代码的示例,如何让按钮/标签滑动?

http://www.iamkreative.co.uk/jquery/slideout_div.html

我的HTML

<div><!--sample page content-->
    <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 
    </p>
</div>

<div id="panel" class="height"> <!--the hidden panel -->
    <div class="content">
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore</p>
    </div>  
</div>

<!--if javascript is disabled use this link-->
<div id="tab-container" class="height">
    <a href="#" onclick="return()">
        <div id="tab"><!-- this will activate the panel. --></div> 
    </a>
</div>
Run Code Online (Sandbox Code Playgroud)

我的jQuery

$(document).ready(function(){

$("#panel, .content").hide(); //hides …
Run Code Online (Sandbox Code Playgroud)

jquery panel sliding jquery-animate

7
推荐指数
1
解决办法
5万
查看次数

将Ajax变量传递给Codeigniter函数

我认为这很简单.

我有一个Codeigniter函数,它从表单中获取输入并将它们插入到数据库中.我想Ajax化这个过程.目前函数的第一行从表单中获取id字段 - 我需要更改它以从Ajax帖子(它引用包含必要值的表单中的隐藏字段)获取id字段.我该怎么办?

我的Codeigniter控制器功能

function add()
{
    $product = $this->products_model->get($this->input->post('id'));

    $insert = array(
            'id' => $this->input->post('id'),
            'qty' => 1,
            'price' => $product->price,
            'size' => $product->size,
            'name' => $product->name
        );

    $this->cart->insert($insert);
    redirect('home');
}
Run Code Online (Sandbox Code Playgroud)

和jQuery Ajax函数一样

$("#form").submit(function(){
        var dataString = $("input#id") 
        //alert (dataString);return false;  
        $.ajax({  
            type: "POST",  
            url: "/home/add",  
            data: dataString,  
            success: function() {

            }  
        });
        return false;
    });
Run Code Online (Sandbox Code Playgroud)

一如既往,非常感谢提前.

jquery codeigniter

4
推荐指数
1
解决办法
7014
查看次数

Doctrine - 通过一个查询从两个表中获取数据

有人可以用基本的Doctrine查询来帮助我吗?我刚刚将一个大的Orders表拆分为mysql中的单独'Customers'和'Orders'表.我现在在我的Codeigniter/Doctrine应用程序中设置了两个表:

<?php

class Orders extends Doctrine_Record {

public function setTableDefinition() {
    $this->hasColumn('order_date', 'string', 10);
    $this->hasColumn('item_code', 'string', 10);
    $this->hasColumn('invoice_number', 'string', 11);
    $this->hasColumn('item_name', 'string', 30);
    $this->hasColumn('item_type', 'string', 15);
    $this->hasColumn('item_size', 'integer', 1);
    $this->hasColumn('item_price', 'integer', 3);
    $this->hasColumn('item_quantity', 'integer', 3);
    $this->hasColumn('item_total_price', 'integer', 5);
    $this->hasColumn('item_b_order', 'integer', 1);
    $this->hasColumn('order_total_items', 'integer', 5);
    $this->hasColumn('order_total', 'integer', 6);
    $this->hasColumn('cust_id', 'integer', 4);
    $this->hasColumn('hallmark', 'integer', 1);
}
public function setUp() {
    // setup the join with the Customers table, linking cust_id in this table with id in Customers table
    $this->hasOne('Customers', array(
        'local' => …
Run Code Online (Sandbox Code Playgroud)

doctrine join

2
推荐指数
1
解决办法
6450
查看次数

标签 统计

jquery ×2

codeigniter ×1

doctrine ×1

join ×1

jquery-animate ×1

panel ×1

sliding ×1